2017-08-04 10:02:02 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
2019-07-16 03:44:31 +08:00
|
|
|
use App\Contracts\Model;
|
2020-03-26 06:04:26 +08:00
|
|
|
use Carbon\Carbon;
|
2018-03-20 09:50:40 +08:00
|
|
|
|
2020-03-26 06:04:26 +08:00
|
|
|
/**
|
|
|
|
* @property string user_id
|
|
|
|
* @property string flight_id
|
|
|
|
* @property Carbon created_at
|
|
|
|
* @property Carbon updated_at
|
|
|
|
*/
|
2018-03-20 09:50:40 +08:00
|
|
|
class Bid extends Model
|
2017-08-04 10:02:02 +08:00
|
|
|
{
|
2018-02-28 03:25:32 +08:00
|
|
|
public $table = 'bids';
|
2017-08-04 10:02:02 +08:00
|
|
|
|
2018-03-21 08:40:19 +08:00
|
|
|
protected $fillable = [
|
2017-12-13 01:49:35 +08:00
|
|
|
'user_id',
|
|
|
|
'flight_id',
|
|
|
|
];
|
2017-08-04 10:02:02 +08:00
|
|
|
|
2018-07-25 03:50:50 +08:00
|
|
|
protected $casts = [
|
|
|
|
'user_id' => 'integer',
|
|
|
|
];
|
|
|
|
|
2017-08-04 10:02:02 +08:00
|
|
|
/**
|
|
|
|
* Relationships
|
|
|
|
*/
|
|
|
|
public function flight()
|
|
|
|
{
|
2018-01-08 23:22:12 +08:00
|
|
|
return $this->belongsTo(Flight::class, 'flight_id');
|
2017-08-04 10:02:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public function user()
|
|
|
|
{
|
2018-01-08 23:22:12 +08:00
|
|
|
return $this->belongsTo(User::class, 'user_id');
|
2017-08-04 10:02:02 +08:00
|
|
|
}
|
|
|
|
}
|