phpvms/app/Models/Expense.php

51 lines
942 B
PHP
Raw Normal View History

<?php
namespace App\Models;
2018-08-27 00:40:04 +08:00
use App\Contracts\Model;
use App\Models\Traits\ReferenceTrait;
/**
* Class Expense
2018-08-27 00:40:04 +08:00
*
* @property int airline_id
* @property float amount
2018-03-03 07:29:11 +08:00
* @property string name
2018-04-02 03:32:01 +08:00
* @property string ref_model
* @property string ref_model_id
*/
class Expense extends Model
{
use ReferenceTrait;
public $table = 'expenses';
2018-03-21 08:40:19 +08:00
protected $fillable = [
'airline_id',
'name',
'amount',
'type',
'multiplier',
'charge_to_user',
2018-04-02 03:32:01 +08:00
'ref_model',
'ref_model_id',
'active',
];
public static $rules = [
'active' => 'boolean',
'airline_id' => 'integer',
'amount' => 'float',
'multiplier' => 'bool',
'charge_to_user' => 'bool',
];
/**
* Foreign Keys
*/
public function airline()
{
return $this->belongsTo(Airline::class, 'airline_id');
}
}