Laravel маршрут не работает. localhost8000 / {route} / create всегда игнорируется. Кажется, что функция create () контроллера не вызывается. Браузер пытается установить ссылку на ту же страницу или / home. Как это исправить?
web. php
Route::resource('/debug', 'WorkerController')->except(['index'])->middleware('auth');
class WorkController extends Controller
{
public function create(WorkRequest $request)
{
Log::debug("This function never be called", "!!");
return view("a");
}
public function store(WorkRequest $request)
{
$schedules = DB::table('schedules')->get();
$request->date;
$request->hours;
$worker_id = strval($request->user()->id);
Log::debug('date=' . $request->date);
//omit
$registerred_schedules = DB::table('worker_schedules')->where('worker_id', $worker_id)->get();
return view('workers.create', ['schedules' => $registerred_schedules]);
}
}
| | POST | debug | debug.store | App\Http\Controllers\WorkController@store | web,auth |
| | GET|HEAD | debug/create | debug.create | App\Http\Controllers\WorkController@create | web,auth |
| | DELETE | debug/{debug} | debug.destroy | App\Http\Controllers\WorkController@destroy | web,auth |
| | PUT|PATCH | debug/{debug} | debug.update | App\Http\Controllers\WorkController@update | web,auth |
| | GET|HEAD | debug/{debug} | debug.show | App\Http\Controllers\WorkController@show | web,auth |
| | GET|HEAD | debug/{debug}/edit | debug.edit | App\Http\Controllers\WorkController@edit | web,auth |