ソースを参照

管理者ユーザー作成コマンド 修正

develop
sosuke.iwabuchi 1年前
コミット
2d3d4d4f0a
1個のファイルの変更10行の追加2行の削除
  1. +10
    -2
      app/Console/Commands/Test/管理者ユーザー登録.php

+ 10
- 2
app/Console/Commands/Test/管理者ユーザー登録.php ファイルの表示

@@ -58,17 +58,25 @@ class 管理者ユーザー登録 extends BaseCommand
$db->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();

// 管理者ログインユーザーの作成
$user = User::whereEmail("hello@gmail.com")
->firstOrNew();

$user->name = "ハローテクノ管理者";
$user->email = "hello@gmail.com";
$user->role = UserRole::ADMIN;
$user->password = "hellouser";
$user->save();

$db->commit();
} catch (Exception $e) {
$db->rollBack();


読み込み中…
キャンセル
保存