Ekapp/skolehjem/database/seeds/UserSeeder.php

29 lines
581 B
PHP
Raw Normal View History

2020-06-29 12:28:09 +00:00
<?php
use Illuminate\Database\Seeder;
class UserSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$user = new \App\User();
$user->name_first = "admin";
$user->name_last = "admin";
$user->email = "admin@admin.local";
$user->setPasswordAttribute("1234");
$user->phone = 12345678;
foreach (\Spatie\Permission\Models\Permission::all() as $permission) {
$user->givePermissionTo($permission);
}
$user->save();
}
}