2017-02-10 4 views
0

ich mein erstes Plugin nur schaffen, jetzt versuche ich es in einem Laravel 5.3Call to undefined Methode Xoco70 Turniere TournamentsServiceProvider :: loadRoutesFrom()

zu installieren Nach dem Hinzufügen der Dienstleister zu app.php, I erhält diese Nachricht:

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


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

Meine Boot-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'); 

    } 

Jede Idee, warum ???

+0

Hat 'TournamentsServiceProvider' zu verlängern' ServiceProvider'? – lagbox

+0

ja, tut es .... –

Antwort

0

endete ich mit Routen in meinem Serviceprovider bis:

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'); 
    }); 
} 
Verwandte Themen