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()
    {
        app()[PermissionRegistrar::class]->forgetCachedPermissions();
        $role1 = Role::create(['name' =>'admin']);
        $role2 = Role::create(['name' =>'mentor']);
        $role3 = Role::create(['name' =>'mentee']);
        $admin = User::create([
            'name' => 'Admin Ajarin.id',
            'email' => 'admin@ajarin.id',
            'password' => bcrypt('Ajarinid123'),
            'role' => 'admin'
        ]);
        $admin->assignRole('admin');
    }
public function run ( ) { app ( ) [ PermissionRegistrar :: class ] -> forgetCachedPermissions ( ) ; $ role1 = Role :: create ( [ 'name' => 'admin' ] ) ; $ role2 = Role :: create ( [ 'name' => 'mentor' ] ) ; $ role3 = Role :: create ( [ 'name' => 'mentee' ] ) ; $ admin = User :: create ( [ 'name' => 'Admin Ajarin.id' , 'email' => 'admin@ajarin.id' , 'password' => bcrypt ( 'Ajarinid123' ) , 'role' => 'admin' ] ) ; $ admin -> assignRole ( 'admin' ) ; }
Run the database seeds.
Run the database seeds .