37 lines
746 B
PHP
37 lines
746 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class DocumentType extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'code',
|
|
'name',
|
|
'description',
|
|
'max_file_size_kb',
|
|
'allowed_extensions',
|
|
'is_required',
|
|
'is_active',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'max_file_size_kb' => 'integer',
|
|
'is_required' => 'boolean',
|
|
'is_active' => 'boolean',
|
|
];
|
|
}
|
|
|
|
public function studentDocuments(): HasMany
|
|
{
|
|
return $this->hasMany(StudentDocument::class);
|
|
}
|
|
}
|