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;
    }


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3aLe6kI
via IFTTT

Aucun commentaire:

Enregistrer un commentaire