"Administrator", "User" => "Bruger", ]; foreach ($roles as $key => $value) { try { if (\Spatie\Permission\Models\Role::findByName($key)) continue; } catch (Exception $e) { $permission = new \Spatie\Permission\Models\Role(); $permission->name = $key; $permission->description = $value; $permission->save(); } } } }