我按照 Laravel.com 上的升级指南进行了操作。完成后,我运行了 composer update 命令,但是出现了以下错误。请问有人知道如何解决这个问题吗?
谢谢你的帮助。
FatalThrowableError in RouteServiceProvider.php line 73:
Class 'App\Providers\Route' not found
routeserviceprovider.php
<?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 the controller routes in your routes file.
*
* 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()
{
//
parent::boot();
Route::bind('tags', function($name)
{
return \App\Tag::where('name', $name)->firstOrFail();
});
Route::bind('exercise_slug', function($slug)
{
return \App\Exercise::where('slug', $slug)->firstOrFail();
});
Route::bind('exerciseplan_slug', function($slug)
{
return \App\ExercisePlan::where('slug', $slug)->firstOrFail();
});
//Route::bind('profile',function($name){
//return \App\User::whereName($name)->firstOrFail();
//});
Route::bind('article_slug', function($name) {
return \App\Article::where('slug', $name)->firstOrFail();
});
Route::bind('training_request_slug', function($slug)
{
return \App\TrainingRequest::where('slug', $slug)->firstOrFail();
});
Route::bind('trainer_profile', function($user_id)
{
return \App\TrainerProfile::where('user_id',$user_id)->firstOrFail();
});
}
/**
* Define the routes for the application.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function map(Router $router)
{
Route::group(['namespace' => $this->namespace], function ($router) {
require app_path('Http/routes.php');
});
}
}