mardi 5 avril 2016

Laravel 5.1 Class '\App\User' not found, FatalErrorException in EloquentUserProvider.php line 126

I moved my User Model from App\User to App\Models\Users, I followed the proper instruction, the same thing working properly on Windows OS, while facing error on Ubuntu 14.04

Whenever I try to Login(When submit information) it gives me error

FatalErrorException in /var/www/html/sms/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php

line 126: Class '\App\User' not found

I also run composer dump-autoload command, but no luck. Also tried this

http://ift.tt/1q5vkP5

Here is my settings for Models directory

composer.json

"autoload": {
    "classmap": [
        "database",
        "app/Models"
    ],
    "psr-4": {
        "App\\": "app/"
    }
},

Model Directory Structure App/Models/

Model User.php

namespace App\Models;

Auth.php tried both lines, given below.

'model' => App\Models\User::class,
'model' => App\Models\User,

AuthController.php

use App\Models\User;

EloquentUserProvider.php path is sms/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php line 126

public function createModel()
{
    $class = '\\'.ltrim($this->model, '\\');

    return new $class; //line# 126
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire