for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* NOTICE OF LICENSE
*
* Part of the Rinvex Fort Package.
* This source file is subject to The MIT License (MIT)
* that is bundled with this package in the LICENSE file.
* Package: Rinvex Fort Package
* License: The MIT License (MIT)
* Link: https://rinvex.com
*/
namespace Rinvex\Fort\Seeds;
use Carbon\Carbon;
use Rinvex\Fort\Models\User;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class UsersSeeder extends Seeder
{
/**
* Run the database seeds.
* @return void
public function run()
DB::statement('SET FOREIGN_KEY_CHECKS=0;');
DB::table(config('rinvex.fort.tables.users'))->truncate();
$user = [
'username' => 'Fort',
'email' => '[email protected]',
'email_verified' => true,
'email_verified_at' => Carbon::now(),
'remember_token' => str_random(10),
'password' => $password = str_random(),
'active' => true,
];
$user = User::create($user);
if (isset($this->command)) {
$this->command->getOutput()->writeln("<comment>Username</comment>: {$user['username']} / <comment>Password</comment>: {$password}");
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.
}
// Assign roles to users
$user->assignRoles('admin');
DB::statement('SET FOREIGN_KEY_CHECKS=1;');
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.