pintu2/database/seeders/UserRoleSeeder.php
efbe b815d0396f
All checks were successful
Run Action to Production / run pull to sync on target message (push) Has been skipped
add spatie laravel roles
2024-03-02 18:06:48 +07:00

26 lines
654 B
PHP

<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Spatie\Permission\Contracts\Role;
use Spatie\Permission\Models\Role as ModelsRole;
class UserRoleSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
ModelsRole::updateOrCreate(
['name'=> 'Super Administrator'],
['name'=> 'Super Administrator'],
);
ModelsRole::create(['name'=> 'Tenaga Kependidikan']);
ModelsRole::create(['name'=> 'Dosen']);
ModelsRole::create(['name'=> 'Operator Akademik']);
}
}