add airports table and #7 integrate permissions

This commit is contained in:
Nabeel Shahzad
2017-06-11 11:36:16 -05:00
parent 35f660d1d9
commit d3cf57a1d1
25 changed files with 640 additions and 60 deletions

52
app/Models/Airport.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
namespace App\Models;
use Eloquent as Model;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* Class Airport
* @package App\Models
*/
class Airport extends Model
{
use SoftDeletes;
public $table = 'airports';
protected $dates = ['deleted_at'];
public $fillable = [
'icao'
];
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts = [
];
/**
* Validation rules
*
* @var array
*/
public static $rules = [
'icao' => 'required'
];
public function save(array $options = [])
{
if(in_array('icao', $options)) {
$options['icao'] = strtoupper($options['icao']);
}
return parent::save($options);
}
}