Ekapp/skolehjem/database/seeds/UserSeeder.php

55 lines
1.5 KiB
PHP
Raw Permalink Normal View History

2020-06-29 12:28:09 +00:00
<?php
2020-06-30 08:09:31 +00:00
use App\User;
2020-06-29 12:28:09 +00:00
use Illuminate\Database\Seeder;
2020-06-30 08:55:58 +00:00
use Illuminate\Support\Facades\Log;
2020-06-29 12:28:09 +00:00
class UserSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
/**
* A user is created as the Admin with the below fields.
* Super User or Admin. Is allowed for all permission and is not to exist in final product release but purely for testing.
*/
2020-06-29 12:28:09 +00:00
$user = new \App\User();
2020-08-05 08:22:10 +00:00
$user->name_first = "Admin";
$user->name_last = "Admin";
2020-06-29 12:28:09 +00:00
$user->email = "admin@admin.local";
$user->setPasswordAttribute("1234");
$user->phone = "12345678";
//$user->eduenddate = "2024-01-03";
//$user->education = "Datatekniker med programmering";
//Gives Administrator role to the Admin
$user->assignRole("Administrator");
$user->save();
/**
* A user is created as the Admin with the below fields.
* Super User or Admin. Is allowed for all permission and is not to exist in final product release but purely for testing.
*/
$user = new \App\User();
$user->name_first = "X";
$user->name_last = "X";
$user->email = "x@x.x";
$user->setPasswordAttribute("1");
$user->phone = "12345679";
//$user->eduenddate = "2024-02-03";
//$user->education = "Datatekniker med programmering";
2020-06-29 12:28:09 +00:00
2020-07-30 10:28:05 +00:00
//Gives Administrator role to the Admin
$user->assignRole("Administrator");
2020-06-29 12:28:09 +00:00
$user->save();
}
}