“Rute :: apapun” Kode Jawaban

Rute :: apapun

Route::get('/user/{name?}', function ($name = null) {
    return $name;
});
 
Route::get('/user/{name?}', function ($name = 'John') {
    return $name;
});
Dead Dragonfly

Rute :: apapun

use Illuminate\Http\Request;
 
Route::get('/user/{id}', function (Request $request, $id) {
    return 'User '.$id.' user';
});
Dead Dragonfly

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya