New Model for Event,Booking and Course

This commit is contained in:
Mathieu Lagace
2019-08-17 11:43:52 -04:00
parent b850b38b85
commit d4b3b1b47d
20 changed files with 629 additions and 61 deletions

23
app/Event.php Normal file
View File

@@ -0,0 +1,23 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Event extends Model
{
public function bookings()
{
return $this->morphMany('App\Booking', 'bookable');
}
public function courses()
{
return $this->hasMany('App\Course');
}
public function user()
{
return $this->belongsTo('App\User');
}
}