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 ]); }