Level 1
You can define your api in routes/api.php and write the first api:
Route::get('foo', function () {
return 'Hello World';
});
and run it:
http://{your_host_url}/api/foo
Check it for more info: https://laravel.com/docs/7.x/routing
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
How can i make a simple API and use it to my website
Please or to participate in this conversation.