samedi 26 décembre 2020

Call to undefined method App\Http\Controllers\ProfilesController::authorize()

I am getting error Call to undefined method App\Http\Controllers\ProfilesController::authorize() in Laravel 5.8xx but I think I am doing everything right.

Controller:

public function edit(User $user)
    {
        $this->authorize('update', $user->profile);
        return view('profiles.edit', compact('user'));
 
    }

Profile Policy

public function update(User $user, Profile $profile)
    {
        return $user->id == $profile->user_id;
    }


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire