Skip to content

Instantly share code, notes, and snippets.

@nataliaconde
Created May 15, 2023 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nataliaconde/2c33dfd30ded2dd11e8cc63a21edb37f to your computer and use it in GitHub Desktop.
Save nataliaconde/2c33dfd30ded2dd11e8cc63a21edb37f to your computer and use it in GitHub Desktop.
<?php
namespace App\Providers;
use App\Models\Post;
use App\Policies\PostPolicy;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Gate;
class AuthServiceProvider extends ServiceProvider
{
/**
* The application’s policy mappings.
*
* @var array
*/
protected $policies = [
Post::class => PostPolicy::class,
];
/**
* Register all authorization and authentication services.
*/
public function boot(): void
{
// …
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment