3
0
Fork 0
This repository has been archived on 2024-11-14. You can view files and clone it, but cannot push or open issues or pull requests.
ThemeParkPlus-Panel/database/seeds/DatabaseSeeder.php

32 lines
713 B
PHP
Raw Permalink Normal View History

<?php
use App\User;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
$this->call(PermissionSeeder::class);
$user = User::create([
'firstname' => 'Admin',
'surname' => '',
'email' => 'admin@localhost',
'password' => Hash::make('admin'),
]);
DB::table('users')->where('id', $user->id)->update([
'email_verified_at' => DB::raw('CURRENT_TIMESTAMP')
]);
$user->assignRole('administrator');
}
}