mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-11-30 22:20:45 +00:00
23 lines
532 B
PHP
23 lines
532 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Spatie\Permission\Models\Permission;
|
|
|
|
class PermissionsTableSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
$routes = include(resource_path('lang/zh-CN/permission.php'));
|
|
foreach ($routes as $key => $route) {
|
|
$data = ['id' => $route['id'], 'name' => $key, 'guard_name' => 'api'];
|
|
Permission::firstOrCreate($data);
|
|
}
|
|
}
|
|
}
|