phpvms/app/Models/Airline.php
2017-12-29 16:56:46 -06:00

49 lines
758 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 = [
'code' => 'required|max:3|unique:airlines',
'name' => 'required',
];
/**
* For backwards compatibility
*/
public function getCodeAttribute() {
return $this->icao;
}
}