I'm using laravel 5.5.4 the latest version I think. I'm getting this error in my seeder it says.
In Builder.php line 2483:
Call to undefined method Illuminate\Database\Query\Builder::attachPermissions()
This is my code in my seeder and below that is my User model - note that if I take away the notifiable trait in the user model it still get the same error.
`<?php
use Illuminate\Database\Seeder;
use App\User;
use App\Permission;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Zizaco\Entrust\Traits\EntrustUserTrait;
class User extends Authenticatable
{
use Notifiable, 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',
];
I'm using laravel 5.5.4 the latest version I think. I'm getting this error in my seeder it says.
In Builder.php line 2483:
Call to undefined method Illuminate\Database\Query\Builder::attachPermissions()
This is my code in my seeder and below that is my User model - note that if I take away the notifiable trait in the user model it still get the same error.
`<?php
use Illuminate\Database\Seeder; use App\User; use App\Permission;
class UsersTableSeeder extends Seeder { /**
@return void */ public function run() { //
$admin->roles()->attach(2);
$brand_permissions = Permission::whereIn('name', ['index-brands', 'create-brand', 'edit-brand', 'delete-brand'])->get();
$admin->attachPermissions($brand_permissions);
} }`
`<?php
namespace App;
use Illuminate\Notifications\Notifiable; use Illuminate\Foundation\Auth\User as Authenticatable; use Zizaco\Entrust\Traits\EntrustUserTrait;
class User extends Authenticatable { use Notifiable, EntrustUserTrait;
}`