protected function getAuthority() { if ($this->authority instanceof Model) { return $this->authority; } return Models::role()->firstOrCreate(['name' => $this->authority]); }