PHP Fatal error: Class 'App\Providers\Route' not found in /home/****/**********/app/Providers/RouteServiceProvider.php on line 28
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'App\Providers\Route' not found
Run Code Online (Sandbox Code Playgroud)
以上是我试图运行Artisan时所看到的错误.似乎问题与我的过滤器(我试图从Laravel 4迁移到5)和Namespacing有关.我有两个命名空间,我希望所有这些过滤器适用于:"App\Http\Controllers\API\V1"和"App\Http\Controllers\API\V2",但不能为我的生活理解如何在RouteServiceProvidor文件中设置它.以下是从RSP.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.
* …Run Code Online (Sandbox Code Playgroud) 我决定在这里完全推出SQL文件.
CREATE TABLE Account
(
AccountNumber INTEGER NOT NULL PRIMARY KEY,
Name varchar(30) NOT NULL
);
CREATE SEQUENCE SEQ_ADDR START WITH 1 INCREMENT BY 1;
CREATE TABLE Address
(
AddressNumber INTEGER NOT NULL PRIMARY KEY,
AccountNumber INTEGER NOT NULL,
IsPrimary INTEGER NOT NULL,
StreetName varchar(50) NOT NULL,
ZipCode INTEGER NOT NULL
);
CREATE TABLE Bill
(
AccountNumber INTEGER NOT NULL,
EndDate DATE NOT NULL,
StartDate DATE NOT NULL,
DueDate DATE NOT NULL,
CONSTRAINT BillFK FOREIGN KEY (AccountNumber) REFERENCES Account(AccountNumber),
CONSTRAINT …Run Code Online (Sandbox Code Playgroud)