Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ohffs's avatar
Level 50

API/Passport series?

I'm sure this must have been asked before - but my searches are mostly turning up questions about API's - so sorry if I'm the 100th person to ask ;-)

I guess a lot of us are ending up with more Hybrid/SPA type codebases and it'd be really nice to have a series - even something like the recent Relationships one - that went through some of the terminology, some ways to handle auth, dealing with ye olde fashioned 'session' data etc. There's quite a lot of stuff about interacting with other people's API's or making requests to your own site to 'traditionally' logged in users - but I can't find much about actually making your own auth'd API and how to use it in a Laravel/Passport context.

Selfish self-interested disclosure - I'm currently working on a site that will have a 'local' API (ie, users log into the site and get blade views etc - but those in turn fetch data from the local API - mostly as a dog-fooding exercise) - but with a second sister application which will work only via the API. Trying to get my head around the terms, passport middlewares etc has been a bit trial-and-error to say the least ;-)

Anyway - it'd be much appreciated by this befuddled old dev anyway :-)

0 likes
6 replies
ohffs's avatar
Level 50

@D9705996 yeah - I've read quite a few blogs that are covering the straight-forward use-case - I guess I'm more interested in the uncommon use-cases ;-)

Maybe the problem is that passport is a huge package - but there's very, very little out there about using it in real life beyond 'now you can log in! woo - we're done!' ;-)

My API will be consumed by 'local' users (in a traditional laravel sense), external 'SPA' users and there will also be pure machine-to-machine consumers. Figuring out the mix of middlewares, terms etc is not very clear - so that's why I put in the series request :-)

1 like
D9705996's avatar
D9705996
Best Answer
Level 51

@ohffs - I too would very much welcome a series as Jeffrey has a skill in being able take the complex and make it seem ridiculously simple.

1 like
ohffs's avatar
Level 50

Oops - didn't mean to mark your answer as the 'right' one (clumsy mouse-click!), @D9705996 - but have some points anyway ;-)

1 like
Loach's avatar

@ohffs @D9705996

I would suggest you both check out codecourse.com. Alex has several series covering Passport on there. It is cheaper for a month there thanhere at laracasts. I suggest you purchase a month and try it out. Alex like Jeffrey is a great teacher.

ohffs's avatar
Level 50

@Loach the search on the site only shows one course specifically about passport? And it seems to just be the regular oauth login flow rather than anything about running your own API with multiple types of consumer?

Please or to participate in this conversation.