Formation Laravel - Expert
Formation Laravel - Expert
use Illuminate\Support\Facades\Gate;
$this->registerPolicies();
});
In blade :
@can('edit-post', $post)
@endcan
In the AuthServiceProvider
use App\Models\Post;
use App\Policies\PostPolicy;
protected $policies = [
Post::class => PostPolicy::class,
];
In post controller
$this->authorize('view', $post);
In postPolicy
2. URL:
Localhost/api/V1/status
Add new column in Database :
In the migration
});
}