%PDF- %PDF-
Direktori : /home/silvzytp/crm-dub-code/database/seeders/ |
Current File : /home/silvzytp/crm-dub-code/database/seeders/RoleSeeder.php |
<?php namespace Database\Seeders; use App\Models\Role; use App\Models\Permission; use Illuminate\Database\Seeder; use Illuminate\Database\Console\Seeds\WithoutModelEvents; class RoleSeeder extends Seeder { /** * Run the database seeds. * * @return void */ public function run() { $permissions = Permission::all(); Role::updateOrCreate(['name' => 'Super Admin', 'slug' => 'super-admin']) ->permissions() ->sync($permissions->pluck('id')); Role::updateOrCreate(['name' => 'Admin', 'slug' => 'admin']) ->permissions() ->sync($permissions->pluck('id')); Role::updateOrCreate(['name' => 'Manager', 'slug' => 'manager']) ->permissions() ->sync($permissions->pluck('id')); Role::updateOrCreate(['name' => 'Agent', 'slug' => 'agent']) ->permissions() ->sync($permissions->pluck('id'));; } }