How can I do Authorization Policies in Laravel 5.3?
问题 I read here : https://laravel.com/docs/5.3/authorization#writing-policies And I tried to like this My FavoritePolicy is like this : <?php namespace App\Policies; use App\User; use App\Models\Favorite; use Illuminate\Auth\Access\HandlesAuthorization; class FavoritePolicy { use HandlesAuthorization; public function view(User $user, Favorite $favorite) { return $user->id === $favorite->user_id; } } My FavoriteController is like this : <?php use App\Models\Favorite; ... class FavoriteController