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

mooseh's avatar

Laravel API?

So Im okay with vanilla php at making an API, its pretty simple stuff, but i cannot find anywhere after a long search around google how to send an API request TO laravel, as they're all explain how to send FROM laravel. for instance i have connected status tiny api like below

Route::get('streams/status/{stream}', 'streamController@streamStatus');

this is a really really simple starter for me for an API, all this returns is 1 or a 0 1 being connected, 0 being disconnected.

this is sat behind the api middleware.

lets say for example how would i send a request to this from a vanilla php script?

I know the curl processes so im sure if you just point me in the right way i'll wobble down the right route :)

0 likes
6 replies
ohffs's avatar
ohffs
Best Answer
Level 50

Guzzle is the usual 'go-to' these days. I use httpful sometimes though as I find it a bit more stable and easy though :-)

mooseh's avatar

Yeh i know to use guzzle that not an issue :) but more like how do i authenticate to get the things from the page, is it just general OAuth?

ohffs's avatar

I guess so - passport is the new built in option. Or jwt tokens for a simpler option.

Edit: beaten to it again ;-)

mooseh's avatar

could someone point me in the right place for "passport" authentication? the problem is I wont have any issues building the API, but what i need to know is how someone would authenticate to laravel's api middleware :D

mooseh's avatar

thank ohffs, i used passport :)

Please or to participate in this conversation.