Files
symfonycast.local/app/Models/Course.php
2022-08-23 08:09:14 +02:00

43 lines
845 B
PHP

<?php
namespace App\Models;
use Carbon\Traits\Date;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* @property int $course_id
* @property string $name
* @property string $thumbnail
* @property string $link
* @property string $status
* @property integer $numberofchapters
* @property integer $timeswatched
* @property Date $published_at
*/
class Course extends Model
{
use HasFactory;
protected $fillable = [
'name',
'thumbnail',
'link',
'status',
'numberofchapters',
'timeswatched',
'published_at',
];
protected $dates = [
'published_at'
];
public function chapters(): HasMany
{
return $this->hasMany(Chapter::class);
}
}