2018-02-25 05:38:25 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
2018-03-20 09:50:40 +08:00
|
|
|
use App\Interfaces\Model;
|
|
|
|
|
2018-02-25 05:38:25 +08:00
|
|
|
/**
|
|
|
|
* Class PirepFare
|
|
|
|
* @package App\Models
|
|
|
|
*/
|
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;
|
|
|
|
|
|
|
|
public $fillable = [
|
|
|
|
'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');
|
|
|
|
}
|
|
|
|
}
|