$route) { $data = ['id' => $route['id'], 'name' => $key, 'guard_name' => 'api']; Permission::firstOrCreate($data); } } }