mirror of https://github.com/4xmen/xshop.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
549 B
PHP
25 lines
549 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
use Illuminate\Database\Seeder;
|
|
use Spatie\Permission\Models\Role;
|
|
|
|
class UserSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
\App\Models\User::factory()->count(1)->create(['email' => 'admin@example.com']);
|
|
$role = Role::create(['name' => 'super-admin']);
|
|
$superAdmin = User::where('id',1)->first()->assignRole($role);
|
|
|
|
}
|
|
}
|