public function safeDown() { AuthItemChild::deleteAll(['parent' => $this->getRoles()]); AuthItemChild::deleteAll(['child' => $this->getRoles()]); AuthItem::deleteAll(['name' => $this->getRoles()]); return true; }
public function down() { foreach ($this->getPermissions() as $role => $permissions) { AuthItemChild::deleteAll(['parent' => $role, 'child' => $permissions]); AuthItem::deleteAll(['name' => $permissions]); } return true; }