未找到Laravel 5.3 Class Flash

时间:2016-10-03 11:21:04

标签: php laravel laravel-5.3

FatalThrowableError in RegisterController.php line 104:
Class 'Flash' not found

我得到上述错误,说Class Flash不包括在内,但我认为我正确地将其包括在内。

namespace App\Http\Controllers\Auth;

use Flash;

1 个答案:

答案 0 :(得分:0)

您的controller应该是: -

namespace App\Http\Controllers;   // change here

use App\Flash; // rewrite this line

use App\Http\Controllers\Controller;  // add this line

class RegisterController extends Controller
{
 // stuff here
}

https://laravel.com/docs/5.3/controllers

您的Flash Model应该是: -

namespace App;

use Illuminate\Database\Eloquent\Model;

class Flash extends Model
{
    //
}

https://laravel.com/docs/5.3/eloquent