staffmanager/database/seeds/NewPermissions.php

28 lines
545 B
PHP
Raw Normal View History

2020-08-30 22:06:01 +00:00
<?php
use Illuminate\Database\Seeder;
2020-08-31 15:41:01 +00:00
use Spatie\Permission\Models\Permission;
use Spatie\Permission\Models\Role;
2020-08-30 22:06:01 +00:00
class NewPermissions extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
2020-08-31 15:41:01 +00:00
$developer = Role::create([
2020-08-30 22:06:01 +00:00
'name' => 'developer'
]);
Permission::create(['name' => 'admin.settings.view']);
Permission::create(['name' => 'admin.settings.edit']);
$developer->givePermissionTo('admin.developertools.use');
}
}