database/seeders/UserSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        $admin = tap(User::create([
            'name' => 'Super Admin',
            'email' => 'admin@tailadmin.dev',
            'password' => bcrypt('admin'),
        ]), function (User $user) {
            (new CreateNewUser())->createTeam($user);
        });
        $editor = tap(User::create([
            'name' => 'Editor',
            'email' => 'editor@tailadmin.dev',
            'password' => bcrypt('editor'),
        ]), function (User $user) {
            (new CreateNewUser())->createTeam($user);
        });
        $simpleUser = tap(User::create([
            'name' => 'Super User',
            'email' => 'user@tailadmin.dev',
            'password' => bcrypt('user'),
        ]), function (User $user) {
            (new CreateNewUser())->createTeam($user);
        });
        $admin->assignRole('Super Admin');
        $editor->assignRole('Editor');
        $simpleUser->assignRole('Simple User');
    }
public function run ( ) { $ admin = tap ( User :: create ( [ 'name' => 'Super Admin' , 'email' => 'admin@tailadmin.dev' , 'password' => bcrypt ( 'admin' ) , ] ) , function ( User $ user ) { ( new CreateNewUser ( ) ) -> createTeam ( $ user ) ; } ) ; $ editor = tap ( User :: create ( [ 'name' => 'Editor' , 'email' => 'editor@tailadmin.dev' , 'password' => bcrypt ( 'editor' ) , ] ) , function ( User $ user ) { ( new CreateNewUser ( ) ) -> createTeam ( $ user ) ; } ) ; $ simpleUser = tap ( User :: create ( [ 'name' => 'Super User' , 'email' => 'user@tailadmin.dev' , 'password' => bcrypt ( 'user' ) , ] ) , function ( User $ user ) { ( new CreateNewUser ( ) ) -> createTeam ( $ user ) ; } ) ; $ admin -> assignRole ( 'Super Admin' ) ; $ editor -> assignRole ( 'Editor' ) ; $ simpleUser -> assignRole ( 'Simple User' ) ; }
Run the database seeds.
Run the database seeds .
/*Admin*/ /*Editor*/ /*Simple User*/ /*Assign Role*/