list trips

add, remove flights
This commit is contained in:
Richard Morgan
2017-05-14 20:57:30 -04:00
parent 37d345840b
commit 09fa83af8b
16 changed files with 426 additions and 4 deletions

View File

@@ -0,0 +1,24 @@
<?php
namespace App\Libraries\Trips\Models;
use Illuminate\Database\Eloquent\Model;
class Flights extends Model
{
protected $fillable = ['destination'];
public function trips()
{
return $this->belongsToMany(Trips::class, 'trip_flights');
}
public function toArray()
{
return [
'id' => $this->id,
'destination' => $this->destination,
];
}
}