add Aircraft CRUD

This commit is contained in:
Nabeel Shahzad
2017-06-08 20:37:51 -05:00
parent e22f621216
commit 3678363766
13 changed files with 495 additions and 0 deletions

55
app/Models/Aircraft.php Normal file
View File

@@ -0,0 +1,55 @@
<?php
namespace App\Models;
use Eloquent as Model;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* Class Aircraft
* @package App\Models
* @version June 9, 2017, 1:06 am UTC
*/
class Aircraft extends Model
{
use SoftDeletes;
public $table = 'aircraft';
protected $dates = ['deleted_at'];
public $fillable = [
'icao',
'name',
'full_name',
'registration',
'active'
];
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts = [
'icao' => 'string',
'name' => 'string',
'full_name' => 'string',
'registration' => 'string',
'active' => 'boolean',
];
/**
* Validation rules
*
* @var array
*/
public static $rules = [
'icao' => 'required|max:4',
'name' => 'required',
'full_name' => 'required',
'registration' => 'required',
];
}