-
Notifications
You must be signed in to change notification settings - Fork 0
08 Admin seeder
Ivan Radunovic edited this page May 9, 2017
·
1 revision
Kreiramo novi seeder:
php artisan make:seeder AdminSeeder
<?php
use Illuminate\Database\Seeder;
class AdminSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$adminRole = \App\Models\Role::where('name', 'Administrator')->first();
\App\Models\User::create([
'name' => 'Admin',
'email' => '[email protected]',
'password' => \Illuminate\Support\Facades\Hash::make('secret'),
'role_id' => $adminRole->id
]);
}
}
Dodali smo admina u bazu podataka, međutim on je trenutno redirektovan na stranu za obične korisnike nakon logina, potrebno je da to ispravimo.
Codingo D.O.O. Podgorica 2017.