public function run() { DB::table('group_user')->delete(); $user = User::whereEmail('admin')->firstOrFail(); $group = Group::whereType(Group::ADMIN)->firstOrFail(); $group->users()->attach($user); }
public function run() { Eloquent::unguard(); DB::table('groups')->delete(); Group::create(array('id' => 1, 'name' => 'Administrador', 'type' => Group::ADMIN)); }