Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

Class 'App\Model' not found #205

Open
kantsverma opened this issue Jan 5, 2017 · 1 comment
Open

Class 'App\Model' not found #205

kantsverma opened this issue Jan 5, 2017 · 1 comment

Comments

@kantsverma
Copy link

kantsverma commented Jan 5, 2017

I have implement the all steps and integrated everything successfully But i am getting this error after login using "Class 'App\Model' not found"

Below is my user model :-

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

use Bican\Roles\Traits\HasRoleAndPermission;
use Bican\Roles\Contracts\HasRoleAndPermission as HasRoleAndPermissionContract;

class User extends Model implements AuthenticatableContract, CanResetPasswordContract, HasRoleAndPermissionContract
{
    use Authenticatable, CanResetPassword, HasRoleAndPermission;
    use Notifiable;
	
    protected $fillable = [
        'name', 'email', 'password',
    ];

    protected $hidden = [
        'password', 'remember_token',
    ];
	
	// delete the user detail table entry when delete user
	public function users_detail()
    {
        return $this->has_many('users_detail');
    }
	// delete the user role table entry when delete user
	public function role_user()
    {
        return $this->has_many('role_user');
    }	

    // this is a recommended way to declare event handlers
    protected static function boot() {
        parent::boot();

        static::deleting(function($user) { // before delete() method call this
             $user->users_detail()->delete();
             $user->role_user()->delete();
             // do the rest of the cleanup...
        });
    }
}

@Ricky-rick
Copy link

Do you have a Model class in the App namespace?

We decided to update and maintain a copy of bican roles. This issue is fixed in this copy.
You can find it on packagist: https://packagist.org/packages/ultraware/roles

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants