2017-06-09 09:02:52 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Eloquent as Model;
|
|
|
|
|
|
|
|
/**
|
2017-06-20 00:50:25 +08:00
|
|
|
* Class Airline
|
2017-06-09 09:02:52 +08:00
|
|
|
* @package App\Models
|
|
|
|
*/
|
2017-06-20 00:50:25 +08:00
|
|
|
class Airline extends Model
|
2017-06-09 09:02:52 +08:00
|
|
|
{
|
|
|
|
public $table = 'airlines';
|
|
|
|
|
|
|
|
protected $dates = ['deleted_at'];
|
|
|
|
|
|
|
|
public $fillable = [
|
|
|
|
'code',
|
|
|
|
'name',
|
2017-06-09 09:46:50 +08:00
|
|
|
'active'
|
2017-06-09 09:02:52 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The attributes that should be casted to native types.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $casts = [
|
|
|
|
'code' => 'string',
|
|
|
|
'name' => 'string',
|
2017-06-09 09:46:50 +08:00
|
|
|
'active' => 'boolean'
|
2017-06-09 09:02:52 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Validation rules
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
public static $rules = [
|
2017-07-03 04:03:25 +08:00
|
|
|
'code' => 'required|max:3|unique:airlines',
|
2017-06-09 09:02:52 +08:00
|
|
|
'name' => 'required',
|
|
|
|
];
|
|
|
|
|
|
|
|
}
|