EscolaLMS/Courses-Import-Export

View on GitHub
src/AuthServiceProvider.php

Summary

Maintainability
A
0 mins
Test Coverage
C
75%
<?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();
        }
    }
}