Вход Регистрация
Файл: vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/AuthServiceProvider.php
Строк: 31
<?php

namespace IlluminateFoundationSupportProviders;

use 
IlluminateSupportFacadesGate;
use 
IlluminateSupportServiceProvider;

class 
AuthServiceProvider extends ServiceProvider
{
    
/**
     * The policy mappings for the application.
     *
     * @var array<class-string, class-string>
     */
    
protected $policies = [];

    
/**
     * Register the application's policies.
     *
     * @return void
     */
    
public function register()
    {
        
$this->booting(function () {
            
$this->registerPolicies();
        });
    }

    
/**
     * Register the application's policies.
     *
     * @return void
     */
    
public function registerPolicies()
    {
        foreach (
$this->policies() as $model => $policy) {
            
Gate::policy($model$policy);
        }
    }

    
/**
     * Get the policies defined on the provider.
     *
     * @return array<class-string, class-string>
     */
    
public function policies()
    {
        return 
$this->policies;
    }
}
Онлайн: 1
Реклама