Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
<?php // routes/web.php use Illuminate\Support\Facades\Route; use App\Http\Controllers\PostController; use App\Http\Controllers\CommentController; // Full resource: GET/POST /posts, GET/PUT/DELETE /posts/{post}, etc. Route::resource('posts', PostController::class); // API resource (no create/edit routes) Route::apiResource('articles', \App\Http\Controllers\Api\ArticleController::class); // Nested resource Route::resource('posts.comments', CommentController::class)->shallow(); // Partial resource — only specific actions Route::resource('photos', \App\Http\Controllers\PhotoController::class) ->only(['index', 'show']); Route::resource('videos', \App\Http\Controllers\VideoController::class) ->except(['destroy']); // Inspect all registered routes // php artisan route:list // Generated route names: // posts.index GET /posts // posts.create GET /posts/create // posts.store POST /posts // posts.show GET /posts/{post} // posts.edit GET /posts/{post}/edit // posts.update PUT /posts/{post} // posts.destroy DELETE /posts/{post}
Result
Open