Slim API deployment - composer install + full CRUD endpoints
This commit is contained in:
31
api/src/Models/LicenseClassTemplate.php
Normal file
31
api/src/Models/LicenseClassTemplate.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
final class LicenseClassTemplate extends Model
|
||||
{
|
||||
protected $table = 'license_class_templates';
|
||||
protected $fillable = ['tenant_id', 'code', 'name', 'is_combination'];
|
||||
protected $casts = ['is_combination' => 'integer'];
|
||||
|
||||
public function tenant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Tenant::class, 'tenant_id');
|
||||
}
|
||||
|
||||
public function requirements(): HasMany
|
||||
{
|
||||
return $this->hasMany(LicenseTemplateRequirement::class, 'template_id');
|
||||
}
|
||||
|
||||
public function students(): HasMany
|
||||
{
|
||||
return $this->hasMany(Student::class, 'template_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user