我受困于用戶個人資料功能,我希望只有經過身份驗證的用戶才能訪問他們自己的個人資料。用戶 withid: 1只能訪問路由/applicants/profile/1,否則返回404 Not found?class ApplicantProfileController extends Controller{ public function show(Applicant $applicant) { return view('applicant.show', compact('applicant')); }}route::group(['prefix' => 'applicants', 'middleware' => 'auth:applicant'], function() { Route::get('/profile/{applicant}', 'Profiles\ApplicantProfileController@show');});
如何限制經過身份驗證的用戶只能訪問其個人資料
寶慕林4294392
2023-08-26 17:41:24
