database/seeds/DatabaseSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        app()['cache']->forget('spatie.permission.cache');
        $role = Role::create(['name' => 'admin']);
        $user = new App\User();
        $user->password = Hash::make('admin');
        $user->email = 'admin@expenses.com';
        $user->name = 'Admin';
        $user->save();
        $user->assignRole('admin');
        $this->createUserExpenses($user, 'Admin', 2, 4);
        $user = new App\User();
        $user->password = Hash::make('user');
        $user->email = 'user@expenses.com';
        $user->name = 'User';
        $user->save();
        $this->createUserExpenses($user, 'User', 3, 5);
    }
public function run ( ) { app ( ) [ 'cache' ] -> forget ( 'spatie.permission.cache' ) ; $ role = Role :: create ( [ 'name' => 'admin' ] ) ; $ user = new App \ User ( ) ; $ user -> password = Hash :: make ( 'admin' ) ; $ user -> email = 'admin@expenses.com' ; $ user -> name = 'Admin' ; $ user -> save ( ) ; $ user -> assignRole ( 'admin' ) ; $ this -> createUserExpenses ( $ user , 'Admin' , 2 , 4 ) ; $ user = new App \ User ( ) ; $ user -> password = Hash :: make ( 'user' ) ; $ user -> email = 'user@expenses.com' ; $ user -> name = 'User' ; $ user -> save ( ) ; $ this -> createUserExpenses ( $ user , 'User' , 3 , 5 ) ; }
Run the database seeds.
Run the database seeds .