2017-02-10 2 views
0

Я просто создать свой первый плагин, теперь, я пытаюсь установить его в Laravel 5,3Вызов неопределенной метод Xoco70 Турниры TournamentsServiceProvider :: loadRoutesFrom()

После добавления поставщика услуг к app.php, я получить это сообщение:

php artisan vendor:publish -- provider="Xoco70\Tournaments\TournamentsServiceProvider" 


[Symfony\Component\Debug\Exception\FatalThrowableError]           
Call to undefined method Xoco70\Tournaments\TournamentsServiceProvider::loadRoutesFrom() 

Мой ботинок Methode TournamentsServiceProvider:

public function boot() 
    { 
     $this->loadRoutesFrom(__DIR__.'/web.php'); 

     $viewPath = __DIR__.'/../resources/views'; 
     $this->loadViewsFrom($viewPath, 'tournaments'); 

     $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); 
     $this->loadTranslationsFrom(__DIR__ . '/../translations', 'tournaments'); 

//  $this->publishes([__DIR__ . '/views' => base_path('resources/views/vendor/tournaments')]); 
     $this->publishes([__DIR__ . '/../config/tournaments.php' => config_path('tournaments.php'),'tournaments']); 
     $this->publishes([__DIR__ . '/../database/migrations' => $this->app->databasePath() . '/migrations'], 'tournaments'); 
     $this->publishes([__DIR__ . '/../database/seeds' => $this->app->databasePath() . '/seeds'], 'tournaments'); 
     $this->publishes([__DIR__ . '/../database/factories' => $this->app->databasePath() . '/factories'], 'tournaments'); 
     $this->publishes([__DIR__ . '/../resources/assets' => public_path('vendor/tournaments'),], 'tournaments'); 

    } 

Любая идея, почему ???

+0

ли '' TournamentsServiceProvider' расширяющих ServiceProvider'? – lagbox

+0

есть, это .... –

ответ

0

Я закончил тем, в том числе маршруты в моем ServiceProvider:

public function boot(Router $router) 
{ 

    $viewPath = __DIR__ . '/../resources/views'; 
    $this->loadViewsFrom($viewPath, 'tournaments'); 

    $this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); 
    $this->loadTranslationsFrom(__DIR__ . '/../translations', 'tournaments'); 

    $this->publishes([__DIR__ . '/../config/tournaments.php' => config_path('tournaments.php'), 'tournaments']); 
    $this->publishes([__DIR__ . '/../database/migrations' => $this->app->databasePath() . '/migrations'], 'tournaments'); 
    $this->publishes([__DIR__ . '/../database/seeds' => $this->app->databasePath() . '/seeds'], 'tournaments'); 
    $this->publishes([__DIR__ . '/../database/factories' => $this->app->databasePath() . '/factories'], 'tournaments'); 
    $this->publishes([__DIR__ . '/../resources/assets' => public_path('vendor/tournaments'),], 'tournaments'); 

    $router->group(['prefix' => 'tournaments', 'middleware' => ['web']], function ($router) { 
     $router->get('/', 'Xoco70\Tournaments\[email protected]')->name('tree.index'); 
     $router->post('/championships/{championship}/trees', 'Xoco70\Tournaments\[email protected]')->name('tree.index'); 
    }); 
}