vernova/app/Models/Role.php
2026-07-26 19:58:27 +03:30

29 lines
626 B
PHP

<?php
namespace App\Models;
use Spatie\Permission\Models\Role as SpatieRole;
class Role extends SpatieRole
{
/**
* Custom Role model for Vernova that supports multi-tenant scoping.
*
* Adds tenant_id to the fillable array so that roles can be scoped
* to a specific tenant (or be platform-level when tenant_id is null).
*/
protected $fillable = [
'name',
'guard_name',
'tenant_id',
];
/**
* The tenant this role belongs to (null = platform-level role).
*/
public function tenant()
{
return $this->belongsTo(Tenant::class);
}
}