我受困于用戶個(gè)人資料功能,我希望只有經(jīng)過(guò)身份驗(yàn)證的用戶才能訪問(wèn)他們自己的個(gè)人資料。用戶 withid: 1只能訪問(wèn)路由/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');});
如何限制經(jīng)過(guò)身份驗(yàn)證的用戶只能訪問(wèn)其個(gè)人資料
寶慕林4294392
2023-08-26 17:41:24