database/seeds/CreateAdminUserSeeder_old.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        $user = User::create([
        	'name' => 'admin', 
        	'name_kana' => 'アド', 
        	'email' => 'admin@gmail.com',
        	'password' => bcrypt('123456'),
        	'branch_id' =>('1')
        ]);
        $role = Role::create(['name' => 'Admin']);
        $permissions = Permission::pluck('id','id')->all();
        $role->syncPermissions($permissions);
        $user->assignRole([$role->id]);
    }
public function run ( ) { $ user = User :: create ( [ 'name' => 'admin' , 'name_kana' => 'アド',  'email' => 'admin@gmail.com' , 'password' => bcrypt ( '123456' ) , 'branch_id' => ( '1' ) ] ) ; $ role = Role :: create ( [ 'name' => 'Admin' ] ) ; $ permissions = Permission :: pluck ( 'id' , 'id' ) -> all ( ) ; $ role -> syncPermissions ( $ permissions ) ; $ user -> assignRole ( [ $ role -> id ] ) ; }
Run the database seeds.
Run the database seeds .