2017-06-22 01:10:25 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class Ranking
|
|
|
|
* @package App\Models
|
|
|
|
*/
|
2017-12-26 05:19:34 +08:00
|
|
|
class Rank extends BaseModel
|
2017-06-22 01:10:25 +08:00
|
|
|
{
|
|
|
|
|
2017-06-22 02:44:30 +08:00
|
|
|
public $table = 'ranks';
|
2017-06-22 01:10:25 +08:00
|
|
|
|
|
|
|
public $fillable = [
|
|
|
|
'name',
|
|
|
|
'hours',
|
2018-01-04 02:47:12 +08:00
|
|
|
'image_link',
|
2017-06-22 01:10:25 +08:00
|
|
|
'auto_approve_acars',
|
|
|
|
'auto_approve_manual',
|
2018-01-04 02:47:12 +08:00
|
|
|
'auto_promote',
|
2017-06-22 01:10:25 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
protected $casts = [
|
2017-12-31 04:37:10 +08:00
|
|
|
'hours' => 'integer',
|
|
|
|
'auto_approve_acars' => 'bool',
|
2017-12-26 05:19:34 +08:00
|
|
|
'auto_approve_manual' => 'bool',
|
2017-12-31 04:37:10 +08:00
|
|
|
'auto_promote' => 'bool',
|
2017-06-22 01:10:25 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
public static $rules = [
|
2018-01-04 12:04:51 +08:00
|
|
|
'name' => 'required',
|
|
|
|
'hours' => 'required|integer',
|
2017-06-22 01:10:25 +08:00
|
|
|
];
|
2017-06-23 09:55:45 +08:00
|
|
|
|
|
|
|
public function subfleets() {
|
2017-12-31 04:37:10 +08:00
|
|
|
return $this->belongsToMany('App\Models\Subfleet', 'subfleet_rank')
|
|
|
|
->withPivot('acars_pay', 'manual_pay');
|
2017-06-23 09:55:45 +08:00
|
|
|
}
|
2017-06-22 01:10:25 +08:00
|
|
|
}
|