phpvms/app/Models/Airline.php
2017-12-30 14:37:10 -06:00

50 lines
778 B
PHP

<?php
namespace App\Models;
/**
* Class Airline
* @package App\Models
*/
class Airline extends BaseModel
{
public $table = 'airlines';
public $fillable = [
'icao',
'iata',
'name',
'logo',
'country',
'active',
];
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts = [
'active' => 'boolean',
];
/**
* Validation rules
*
* @var array
*/
public static $rules = [
'iata' => 'required|max:5',
'icao' => 'required|max:5',
'name' => 'required',
];
/**
* For backwards compatibility
*/
public function getCodeAttribute() {
return $this->icao;
}
}