Add table/models and admin for expenses #136
This commit is contained in:
38
app/Models/Expense.php
Normal file
38
app/Models/Expense.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?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',
|
||||
'multiplier' => 'integer',
|
||||
'type' => 'integer',
|
||||
];
|
||||
|
||||
/**
|
||||
* Foreign Keys
|
||||
*/
|
||||
|
||||
public function airline()
|
||||
{
|
||||
return $this->belongsTo(Airline::class, 'airline_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user