get(); } /** * Get a specific user by ID. * * @param int $id * @return object|null */ public function getUser(int $id): ?object { return User::find($id); } /** * Get all users. * * @return Collection */ public function getAllUsers(): Collection { return User::all(); } public function ensureSystemUserExists() { $user = User::first(); if (!$user) { $user = User::create([ 'name' => '系統管理員', 'email' => 'admin@example.com', 'password' => bcrypt('password'), ]); } return $user; } }