Laravel Resource Controllers
January 16, 2026
•
1 min read
•
29 views
Table of Contents
Resource controllers:
Create Controller
php artisan make:controller PostController --resource
Register Routes
Route::resource('posts', PostController::class);
Available Methods
index() - GET /posts
create() - GET /posts/create
store() - POST /posts
show() - GET /posts/{post}
edit() - GET /posts/{post}/edit
update() - PUT /posts/{post}
destroy() - DELETE /posts/{post}
Partial Resource
Route::resource('posts', PostController::class)
->only(['index', 'show']);
Route::resource('posts', PostController::class)
->except(['destroy']);
Related Posts
Laravel Sanctum API Authentication Complete Guide
Build secure API authentication with Laravel Sanctum for SPAs and mobile apps.
Laravel Rate Limiting: Protect Your Application
Implement rate limiting to protect your Laravel application from abuse.
Laravel Blade Components: Build Reusable UI
Create powerful reusable components with Laravel Blade.
Comments (0)
No comments yet. Be the first to comment!