#57 user can save flights

This commit is contained in:
Nabeel Shahzad
2017-08-03 21:02:02 -05:00
parent 9156b40979
commit 9d53c0103f
8 changed files with 149 additions and 7 deletions

33
app/Models/UserFlight.php Normal file
View File

@@ -0,0 +1,33 @@
<?php
namespace App\Models;
use Eloquent as Model;
/**
* @package App\Models
*/
class UserFlight extends Model
{
public $table = 'user_flights';
public $timestamps = false;
public $fillable
= [
'user_id',
'flight_id',
];
/**
* Relationships
*/
public function flight()
{
return $this->belongsTo('App\Models\Flight', 'flight_id');
}
public function user()
{
return $this->belongsTo('App\Models\User', 'user_id');
}
}