author_id === $user->id && $model->status !== PageStatus::Published; } /** * Moving a page into or out of the published state is a separate * responsibility from editing its content. */ public function publish(User $user, ?Page $page = null): bool { return $user->can('pages.publish'); } }