我不小心運行作曲家更新,打破了我的網站。我正在使用Laravel 5.2。現在,我得到這個錯誤作曲家更新打破網站Laravel 5.2
ErrorException in EventServiceProvider.php line 8:
Declaration of
App\Providers\
EventServiceProvider::boot(Illuminate\Contracts\Events\ Dispatcher $events) should be compatible with
Illuminate\Foundation\Support\Providers\EventServiceProvider::boot()
我試圖從EventServiceProvider這樣
/**
* Register any other events for your application.
*
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @return void
*/
public function boot()
{
parent::boot();
//
}
EventServiceProvider更改之前刪除參數:
<?php
namespace App\Providers;
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as
ServiceProvider;
class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
'App\Events\SomeEvent' => [
'App\Listeners\EventListener',
],
];
/**
* Register any other events for your application.
*
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @return void
*/
public function boot(DispatcherContract $events)
{
parent::boot($events);
//
}
和RouteServiceProvider.php
/**
* Define your route model bindings, pattern filters, etc.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function boot()
{
//
parent::boot();
}
更改前
RouteServiceProvider:
<?php
namespace App\Providers;
use Illuminate\Routing\Router;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as
ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'App\Http\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function boot(Router $router)
{
//
parent::boot($router);
}
現在,我得到這個錯誤: BadMethodCallException在Macroable.php線74: 方法控制器不存在。
請幫幫我。謝謝。
什麼是你當前laravel的版本,什麼是你以前的(如果你還記得)?同時發佈完整的'EventServiceProvider.php',而不必在更新後進行更改。 – Sandeesh
我編輯了這個問題,請檢查 –
我需要查看完整的課程,而不僅僅是引導方法。我可能知道問題是什麼。需要確認。 – Sandeesh