phpvms/app/Models/Rank.php

40 lines
798 B
PHP
Raw Normal View History

2017-06-22 01:10:25 +08:00
<?php
namespace App\Models;
/**
* Class Ranking
* @package App\Models
*/
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',
'image_link',
2017-06-22 01:10:25 +08:00
'auto_approve_acars',
'auto_approve_manual',
'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',
'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 = [
'name' => 'required',
'hours' => 'required|integer',
2017-06-22 01:10:25 +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-22 01:10:25 +08:00
}