mirror of
https://github.com/brian8544/turtle-wow.git
synced 2024-12-29 02:44:34 +00:00
27 lines
495 B
PHP
27 lines
495 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use TCG\Voyager\Models\Permission;
|
|
use TCG\Voyager\Models\Role;
|
|
|
|
class PermissionRoleTableSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Auto generated seed file.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
$role = Role::where('name', 'admin')->firstOrFail();
|
|
|
|
$permissions = Permission::all();
|
|
|
|
$role->permissions()->sync(
|
|
$permissions->pluck('id')->all()
|
|
);
|
|
}
|
|
}
|