public function updateAuthServiceProviderClass()
    {
        $modelName = $this->modelNames['model_name'];
        $fullModelName = $this->modelNames['full_model_name'];
        $authSPPath = $this->makeAuthServiceProvilderFile(app_path('Providers'), 'AuthServiceProvider.php');

        $authSPContent = $this->files->get($authSPPath);

        if (!is_null($parentName = $this->command->option('parent'))) {
            $modelName = $parentName.'\\'.$modelName;
        }

        $appNamespace = rtrim($this->getAppNamespace(), '\\');

        $authSPContent = str_replace(
            "    protected \$policies = [\n",
            "    protected \$policies = [\n        '{$fullModelName}' => '{$appNamespace}\Policies\\{$modelName}Policy',\n",
            $authSPContent
        );

        $this->generateFile($authSPPath, $authSPContent);

        $this->command->info('AuthServiceProvider class has been updated.');
    }
public function updateAuthServiceProviderClass()
    {
        $modelName = $this->modelNames['model_name'];
        $fullModelName = $this->modelNames['full_model_name'];
        $authSPPath = $this->makeAuthServiceProvilderFile(app_path('Providers'), 'AuthServiceProvider.php');

        $authSPContent = $this->files->get($authSPPath);

        if (!is_null($parentName = $this->command->option('parent'))) {
            $modelName = $parentName.'\\'.$modelName;
        }

        $appNamespace = rtrim($this->getAppNamespace(), '\\');

        $authSPContent = str_replace(
            "    protected \$policies = [\n",
            "    protected \$policies = [\n        '{$fullModelName}' => '{$appNamespace}\Policies\\{$modelName}Policy',\n",
            $authSPContent
        );

        $this->generateFile($authSPPath, $authSPContent);

        $this->command->info('AuthServiceProvider class has been updated.');
    }
public function updateAuthServiceProviderClass ( ) { $ modelName = $ this -> modelNames [ 'model_name' ] ; $ fullModelName = $ this -> modelNames [ 'full_model_name' ] ; $ authSPPath = $ this -> makeAuthServiceProvilderFile ( app_path ( 'Providers' ) , 'AuthServiceProvider.php' ) ; $ authSPContent = $ this -> files -> get ( $ authSPPath ) ; if ( ! is_null ( $ parentName = $ this -> command -> option ( 'parent' ) ) ) { $ modelName = $ parentName . '\\' . $ modelName ; } $ appNamespace = rtrim ( $ this -> getAppNamespace ( ) , '\\' ) ; $ authSPContent = str_replace ( "    protected \$policies = [\n" , "    protected \$policies = [\n        '{$fullModelName}' => '{$appNamespace}\Policies\\{$modelName}Policy',\n" , $ authSPContent ) ; $ this -> generateFile ( $ authSPPath , $ authSPContent ) ; $ this -> command -> info ( 'AuthServiceProvider class has been updated.' ) ; }
Update AuthServiceProviderClass based on created model policy object

@return void
Update AuthServiceProviderClass based on created model policy object