You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
817 B
41 lines
817 B
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class CourseSession extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $fillable = [
|
|
'course_id',
|
|
'title',
|
|
'starts_at',
|
|
'ends_at',
|
|
'venue',
|
|
'capacity',
|
|
'sort',
|
|
];
|
|
|
|
protected $casts = [
|
|
'starts_at' => 'datetime',
|
|
'ends_at' => 'datetime',
|
|
'capacity' => 'integer',
|
|
'sort' => 'integer',
|
|
];
|
|
|
|
public function course(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Course::class);
|
|
}
|
|
|
|
public function signups(): HasMany
|
|
{
|
|
return $this->hasMany(CourseSignup::class);
|
|
}
|
|
}
|