From 7fa51bd306d85b49dc970dc5b147024c5357f347 Mon Sep 17 00:00:00 2001 From: "sosuke.iwabuchi" Date: Sun, 24 Mar 2024 14:15:40 +0900 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E8=80=85=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E4=BD=9C?= =?UTF-8?q?=E6=88=90=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Test/管理者ユーザー登録.php | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 app/Console/Commands/Test/管理者ユーザー登録.php 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; + } +}