Zizaco / entrust

Role-based Permissions for Laravel 5
MIT License
6.05k stars 1.29k forks source link

BadMethodCallException App\User::create() #834

Closed kirkdm closed 6 years ago

kirkdm commented 7 years ago

I'm having an error when seeding to the database using laravel 5.5 the error message is below and there is my users class and my seeder class. What is happening is that one record is being inserted at a time when calling db:seed but after the first call it says BadMethodException rest below

[BadMethodCallException] Call to undefined method App\User::create()

`<?php

namespace App;

use Illuminate\Notifications\Notifiable; use Illuminate\Foundation\Auth\User as Authenticatable; use Zizaco\Entrust\Traits\EntrustUserTrait; use Eloquent;

class User extends Eloquent { use EntrustUserTrait;

/**
 * The attributes that are mass assignable.
 *
 * @var array
 */
protected $fillable = [
    'name', 'email', 'password',
];

/**
 * The attributes that should be hidden for arrays.
 *
 * @var array
 */
protected $hidden = [
    'password', 'remember_token',
];

} `

`<?php

use App\User; use Faker\Factory as Faker; use Illuminate\Database\Seeder;

class UsersTableSeeder extends Seeder { /**

FilipUa-web commented 7 years ago

the same problem

gufrondev commented 7 years ago

me too. I'm using laravel 5.5

oleppe commented 7 years ago

No solution yet?!

fernand0mart1n commented 7 years ago

I'm using laravel 5.5 too, solved it by switching 5.2.x-dev to dev-master.

composer remove zizaco/entrust

and then

composer require zizaco/entrust dev-master

juliarnasution commented 7 years ago

me too