“Rute Laravel API” Kode Jawaban

rute grup Laravel

Route::group(['prefix' => 'admin'], function () {
    Route::get('users', function ()    {
        // Matches The "/admin/users" URL
    });
});
Almabek

Laravel Route Namespace dan awalan

Route::name('admin.')->group(function () {
    Route::get('/users', function () {
        // Route assigned name "admin.users"...
    })->name('users');
});
Perfect Plover

rute () dan dengan () di Laravel

Route::get('user/{id}/profile', function ($id) {
    //
})->name('profile');

$url = route('profile', ['id' => 1, 'photos' => 'yes']);

// /user/1/profile?photos=yes
Lucky Loris

Rute Laravel

Route::get('user/profile', [UserProfileController::class, 'show'])->name('profile');
Sleepy Sandpiper

Tetapkan nama rute Laravel

Route::get('/novanoticia', 'HomeController@getNovaNoticia')->name('route_name');
Route::get('/novanoticia', ['as' => 'route_name', 'uses' => 'HomeController@getNovaNoticia']);
Toukir_Ahmed

Rute Laravel API

Route::get($uri, $callback);
Route::post($uri, $callback);
Route::put($uri, $callback);
Route::patch($uri, $callback);
Route::delete($uri, $callback);
Route::options($uri, $callback);
Real Raven

Jawaban yang mirip dengan “Rute Laravel API”

Pertanyaan yang mirip dengan “Rute Laravel API”

Lebih banyak jawaban terkait untuk “Rute Laravel API” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya