27 خطوط
643 B
PHP
27 خطوط
643 B
PHP
<?php
|
|
|
|
namespace App\Modules\Courses\Domain;
|
|
|
|
use Illuminate\Database\Eloquent\Concerns\HasUlids;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class CourseModule extends Model
|
|
{
|
|
use HasUlids;
|
|
|
|
protected $table = 'course_modules';
|
|
|
|
protected $fillable = ['organization_id', 'course_version_id', 'title', 'position', 'settings', 'is_locked'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['position' => 'integer', 'settings' => 'array', 'is_locked' => 'boolean'];
|
|
}
|
|
|
|
public function lessons(): HasMany
|
|
{
|
|
return $this->hasMany(Lesson::class);
|
|
}
|
|
}
|