32 lines
692 B
PHP
32 lines
692 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Traits\BelongsToTenant;
|
|
use App\Traits\HasUuid;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class License extends Model
|
|
{
|
|
use HasFactory, HasUuid, BelongsToTenant, SoftDeletes;
|
|
|
|
protected $fillable = ['type', 'seats', 'expires_at', 'active', 'tenant_id'];
|
|
|
|
protected $casts = [
|
|
'active' => 'boolean',
|
|
'expires_at' => 'date',
|
|
];
|
|
|
|
public function tenant()
|
|
{
|
|
return $this->belongsTo(Tenant::class);
|
|
}
|
|
|
|
public function assignments()
|
|
{
|
|
return $this->hasMany(LicenseAssignment::class);
|
|
}
|
|
}
|