我受困于用户个人资料功能,我希望只有经过身份验证的用户才能访问他们自己的个人资料。
用户 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');
});
动漫人物