where('is_owner', true)->first() instanceof User) { return; } /** * Inserts an owner with the following credentials: admin: `admin@example.com` password: `castopod` */ // Get the User Provider (UserModel by default) $users = auth() ->getProvider(); $user = new User([ 'username' => 'admin', 'email' => 'admin@castopod.local', 'password' => 'castopod', 'is_owner' => true, ]); $users->save($user); // To get the complete user object with ID, we need to get from the database $user = $users->findById($users->getInsertID()); $user->addGroup(setting('AuthGroups.mostPowerfulGroup')); } }