2018-02-27 05:16:12 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class Expense
|
|
|
|
* @package App\Models
|
|
|
|
*/
|
|
|
|
class Expense extends BaseModel
|
|
|
|
{
|
|
|
|
public $table = 'expenses';
|
|
|
|
|
|
|
|
public $fillable = [
|
|
|
|
'airline_id',
|
|
|
|
'name',
|
|
|
|
'amount',
|
|
|
|
'type',
|
|
|
|
'multiplier',
|
|
|
|
'active',
|
|
|
|
];
|
|
|
|
|
|
|
|
public static $rules = [
|
|
|
|
'active' => 'boolean',
|
|
|
|
'airline_id' => 'integer',
|
|
|
|
'amount' => 'float',
|
2018-03-02 06:20:13 +08:00
|
|
|
'multiplier' => 'bool',
|
2018-02-27 05:16:12 +08:00
|
|
|
'type' => 'integer',
|
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Foreign Keys
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function airline()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Airline::class, 'airline_id');
|
|
|
|
}
|
|
|
|
}
|