Files
tripbuilder/app/Libraries/Trips/Models/Flights.php
Richard Morgan 09fa83af8b list trips
add, remove flights
2017-05-14 20:57:30 -04:00

25 lines
435 B
PHP

<?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,
];
}
}