2018-02-25 05:38:25 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
2019-07-16 03:44:31 +08:00
|
|
|
use App\Contracts\Model;
|
2018-03-20 09:50:40 +08:00
|
|
|
|
2021-02-18 07:54:18 +08:00
|
|
|
/**
|
|
|
|
* @property int id
|
|
|
|
* @property string pirep_id
|
|
|
|
* @property int fare_id
|
|
|
|
* @property int count
|
|
|
|
* @property Pirep pirep
|
|
|
|
* @property Fare fare
|
|
|
|
*/
|
2018-03-20 09:50:40 +08:00
|
|
|
class PirepFare extends Model
|
2018-02-25 05:38:25 +08:00
|
|
|
{
|
|
|
|
public $table = 'pirep_fares';
|
|
|
|
public $timestamps = false;
|
|
|
|
|
2018-03-21 08:40:19 +08:00
|
|
|
protected $fillable = [
|
2018-02-25 05:38:25 +08:00
|
|
|
'pirep_id',
|
|
|
|
'fare_id',
|
|
|
|
'count',
|
|
|
|
];
|
|
|
|
|
|
|
|
protected $casts = [
|
|
|
|
'count' => 'integer',
|
|
|
|
];
|
|
|
|
|
|
|
|
public static $rules = [
|
|
|
|
'count' => 'required',
|
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Relationships
|
|
|
|
*/
|
|
|
|
public function fare()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Fare::class, 'fare_id');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function pirep()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Pirep::class, 'pirep_id');
|
|
|
|
}
|
|
|
|
}
|