- Buka file DatabaseSeeder.php
<?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
public function run()
{
$this->call(UsersTableSeeder::class);
}
}
- Buat UsersTableSeeder.php
$ php artisan make:seeder UsersTableSeeder
- Buka File UsersTableSeeder.php
<?php
use Illuminate\Database\Seeder;
use Carbon\Carbon;
class UsersTableSeeder extends Seeder
{
public function run()
{
DB::table('users')->insert([
'name' => 'Admin',
'email' => '[email protected]',
'password' => bcrypt('admin'),
'created_at' => Carbon::now()->toDateTimeString()
]);
}
}
- Buat auth
$ php artisan make:auth
- Jalankan migration dan seed
$ php artisan migrate --seed
NB:
Untuk menghilangkan fungsi register buka routes/web.php dan tambahkan register => false
Auth::routes(['register' => false]);
Congratulations @irfanmg! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Vote for @Steemitboard as a witness to get one more award and increased upvotes!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit