Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Trait 'Illuminate\Auth\UserTrait' not found

HI i searched Google but did not find anything about this and i never had this error before in Laravel.

I did not modify my user model just added a hasOne relation.

And i keep getting this error what i am not able to solve for 2 hours now

Trait 'Illuminate\Auth\UserTrait' not found 

I did not touch the model

User model

<?php

use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;

class User extends Eloquent implements UserInterface, RemindableInterface {

    use UserTrait, RemindableTrait;

    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'users';

    /**
     * The attributes excluded from the model's JSON form.
     *
     * @var array
     */
    protected $hidden = array('password', 'remember_token');


    public function metadata()
    {
        return $this->hasOne('Metadata');
    }

}

Could someone give me a hand?

like image 961
Web Student Avatar asked Dec 07 '25 23:12

Web Student


1 Answers

Sounds like you need to upgrade to Laravel v4.2.

The Illuminate\Auth\UserTrait class wasn't introduced until v4.2. Check the change log on github.

Check the upgrade guides if you do upgrade as there were a couple of other changes that may break your app.

like image 100
Jeemusu Avatar answered Dec 09 '25 14:12

Jeemusu