diff --git a/app/Console/Commands/Test/管理者ユーザー登録.php b/app/Console/Commands/Test/管理者ユーザー登録.php new file mode 100644 index 0000000..9533e08 --- /dev/null +++ b/app/Console/Commands/Test/管理者ユーザー登録.php @@ -0,0 +1,80 @@ +beginTransaction(); + + // 管理者ログインユーザーの作成 + + $user = User::whereEmail("admin@aa.com") + ->firstOrNew(); + + $user->name = "管理者"; + $user->email = "admin@aa.com"; + $user->role = UserRole::ADMIN; + // $user->password = Hash::make("testuser"); + $user->password = "testuser"; + $user->save(); + + $db->commit(); + } catch (Exception $e) { + $db->rollBack(); + throw $e; + } + + return self::RESULTCODE_SUCCESS; + } +}