database/seeders/RoleSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
         $tech = Role::create(['name' => 'tech']);
         $admin = Role::create(['name' => 'admin']);
         $user = new User;
         $user->name = 'Example Tech';
         $user->email = 'tech@inventory.com';
         $user->password = bcrypt('tech');
         $user->save();
         $user->assignRole($tech);
         $user = new User;
         $user->name = 'Admin';
         $user->email = 'admin@inventory.com';
         $user->password = bcrypt('admin');
         $user->save();
         $user->assignRole($admin);
    }
public function run ( ) { $ tech = Role :: create ( [ 'name' => 'tech' ] ) ; $ admin = Role :: create ( [ 'name' => 'admin' ] ) ; $ user = new User ; $ user -> name = 'Example Tech' ; $ user -> email = 'tech@inventory.com' ; $ user -> password = bcrypt ( 'tech' ) ; $ user -> save ( ) ; $ user -> assignRole ( $ tech ) ; $ user = new User ; $ user -> name = 'Admin' ; $ user -> email = 'admin@inventory.com' ; $ user -> password = bcrypt ( 'admin' ) ; $ user -> save ( ) ; $ user -> assignRole ( $ admin ) ; }
Run the database seeds.
Run the database seeds .
// create roles and assign existing permissions // create demo users