https://dev.to/techtoolindia #make-rest-api-in-laravel-9 Make REST API in LARAVEL 9 In this video i am going to explain about CRUD Operation using REST API.

* * @return void */ public function down() { Schema::dropIfExists('posts'); }}; Next update the Model fillable property in app/models/Post.php json([ 'status' => true, 'posts' => $posts ]); }

* * @param \App\Models\Post $post * @return \Illuminate\Http\Response */ public function edit(Post $post) { // }

* * @param \Illuminate\Http\Request $request * @param \App\Models\Post $post * @return \Illuminate\Http\Response */ public function update(StorePostRequest $request, Post $post) { $post->update($request->all()); return response()->json([ 'status' => true, 'message' => "Post Updated successfully!", 'post' => $post ], 200); }
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