https://dev.to/manu_tech In this tutorial, I am going to take you through the basics in building a REST API in Laravel.

* * @return void */ public function down() { Schema::dropIfExists('posts'); }}; Exit fullscreen mode

Exit fullscreen mode #api-controller Api Controller json([ 'status' => true, 'post' => $posts ]); }

* * @param \App\Models\Post $post * @return \Illuminate\Http\Response */ public function show(Post $post) { $post = Post::find($post)->first(); return response()->json([ 'status' => true, 'post' => $post ]); }
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners