測試指令:
php artisan serve
檔名:routes/web.php
內容:
Route::get('/',function(){
return "Hello! World";
});
Route::get('about',function(){
return "about us";
});
Route::prefix('details')->group(function(){
Route::get('students',function(){
return "this is student";
})->name('student-Details');
Route::get('teachers',function(){
return "this is teacher";
})->name('teacher-Details');
});
Route::get('student/{id}/{reg}',function($id,$reg){
return 'student number '.$id. ' registration number '.$reg;
});
Route::fallback(function(){
return "This page is no found please try again";
});
顯示所有可用路由指令:
php artisan route:list
沒有留言:
張貼留言