Working interface and parsed symfony cast data to a database.
This commit is contained in:
42
app/Models/Course.php
Normal file
42
app/Models/Course.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user