src/AuthServiceProvider.php
<?php
namespace EscolaLms\CoursesImportExport;
use EscolaLms\CoursesImportExport\Models\Course;
use EscolaLms\CoursesImportExport\Policies\CoursesExportPolicy;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Laravel\Passport\Passport;
class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array<class-string, class-string>
*/
protected $policies = [
Course::class => CoursesExportPolicy::class,
];
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
{
$this->registerPolicies();
if (!$this->app->routesAreCached() && method_exists(Passport::class, 'routes')) {
Passport::routes();
}
}
}