aedb1f22b6
* Don't allow cancels from certain states * Unused imports * Don't reset the state doubly * Move SetUserActive into listener; code cleanup * Unused imports * Add missing files into htaccess * Move Command contract to correct folder
55 lines
1.2 KiB
PHP
55 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Contracts\Model;
|
|
|
|
/**
|
|
* @property string name
|
|
* @property int hours
|
|
* @property float manual_base_pay_rate
|
|
* @property float acars_base_pay_rate
|
|
* @property bool auto_promote
|
|
* @property bool auto_approve_acars
|
|
* @property bool auto_approve_manual
|
|
*/
|
|
class Rank extends Model
|
|
{
|
|
public $table = 'ranks';
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'hours',
|
|
'image_url',
|
|
'acars_base_pay_rate',
|
|
'manual_base_pay_rate',
|
|
'auto_approve_acars',
|
|
'auto_approve_manual',
|
|
'auto_promote',
|
|
];
|
|
|
|
protected $casts = [
|
|
'hours' => 'integer',
|
|
'auto_approve_acars' => 'bool',
|
|
'auto_approve_manual' => 'bool',
|
|
'auto_promote' => 'bool',
|
|
];
|
|
|
|
public static $rules = [
|
|
'name' => 'required',
|
|
'hours' => 'required|integer',
|
|
'acars_base_pay_rate' => 'nullable|numeric',
|
|
'manual_base_pay_rate' => 'nullable|numeric',
|
|
];
|
|
|
|
/*
|
|
* Relationships
|
|
*/
|
|
|
|
public function subfleets()
|
|
{
|
|
return $this->belongsToMany(Subfleet::class, 'subfleet_rank')
|
|
->withPivot('acars_pay', 'manual_pay');
|
|
}
|
|
}
|