32 lines
546 B
PHP
Executable File
32 lines
546 B
PHP
Executable File
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class TutorialLesson extends Model
|
|
{
|
|
protected $fillable = [
|
|
'title',
|
|
'content',
|
|
'example_bad',
|
|
'example_good',
|
|
'order',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'order' => 'integer',
|
|
];
|
|
}
|
|
|
|
public function questions(): HasMany
|
|
{
|
|
return $this->hasMany(TutorialQuestion::class);
|
|
}
|
|
}
|