Created
January 7, 2018 14:03
-
-
Save andri-sudarmawijaya/7e30e47a181a02ef53a31ccfcdd6c1a4 to your computer and use it in GitHub Desktop.
How to reset laravel admin password using seeder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- edit file .\database\seeds\DatabaseSeeder.php | |
- add $this->call(AdminUserSeeder::class); | |
``` | |
public function run() | |
{ | |
$this->call(AdminUserSeeder::class); | |
//$this->call(UsersTableSeeder::class); | |
} | |
``` | |
edit file .\database\seeds\AdminUserSeeder.php | |
or file .\database\seeds\UsersTableSeeder.php | |
``` | |
public function run() | |
{ | |
$faker = Faker\Factory::create(); | |
App\User::create([ | |
'name' => 'user', | |
'email' =>'[email protected]', | |
'password' => bcrypt('123456'), | |
]); | |
} | |
``` | |
- jalankan | |
``` | |
php artisan migrate --seed | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment