Working interface and parsed symfony cast data to a database.

This commit is contained in:
Krzysztof Płaczek
2022-08-23 08:09:14 +02:00
parent 119b94470f
commit a92c75c1dd
22 changed files with 488 additions and 224 deletions

42
app/Models/Course.php Normal file
View 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);
}
}