allow setting of IATA code for airline
This commit is contained in:
parent
e9252b4e1c
commit
9a08586564
@ -13,7 +13,7 @@ class DashboardController extends BaseController
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
Feed::$cacheDir = storage_path();
|
||||
Feed::$cacheDir = storage_path('app');
|
||||
Feed::$cacheExpire = '5 hours';
|
||||
|
||||
$feed = Feed::loadRss(config('phpvms.feed_url'));
|
||||
|
@ -16,6 +16,7 @@ class Airline extends Model
|
||||
|
||||
public $fillable = [
|
||||
'code',
|
||||
'iata',
|
||||
'name',
|
||||
'fuel_100ll_cost',
|
||||
'fuel_jeta_cost',
|
||||
|
@ -16,6 +16,7 @@ class CreateAirlinesTable extends Migration
|
||||
Schema::create('airlines', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('code', 5);
|
||||
$table->string('iata', 5);
|
||||
$table->string('name', 50);
|
||||
$table->string('country', 2)->nullable();
|
||||
$table->boolean('active');
|
||||
@ -23,6 +24,9 @@ class CreateAirlinesTable extends Migration
|
||||
|
||||
$table->index('code');
|
||||
$table->unique('code');
|
||||
|
||||
$table->index('iata');
|
||||
$table->unique('iata');
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,11 @@
|
||||
{!! Form::text('code', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('iata', 'IATA:') !!}
|
||||
{!! Form::text('iata', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
|
||||
<!-- Name Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('name', 'Name:') !!}
|
||||
|
@ -10,6 +10,11 @@
|
||||
<p>{!! $airlines->code !!}</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{!! Form::label('iata', 'IATA:') !!}
|
||||
<p>{!! $airlines->iata !!}</p>
|
||||
</div>
|
||||
|
||||
<!-- Name Field -->
|
||||
<div class="form-group">
|
||||
{!! Form::label('name', 'Name:') !!}
|
||||
|
@ -1,6 +1,7 @@
|
||||
<table class="table table-responsive" id="airlines-table">
|
||||
<thead>
|
||||
<th>Code</th>
|
||||
<th>IATA</th>
|
||||
<th>Name</th>
|
||||
<th style="text-align: center;">Active</th>
|
||||
<th colspan="3" style="text-align: right;">Action</th>
|
||||
@ -9,6 +10,7 @@
|
||||
@foreach($airlines as $al)
|
||||
<tr>
|
||||
<td>{!! $al->code !!}</td>
|
||||
<td>{!! $al->iata !!}</td>
|
||||
<td>{!! $al->name !!}</td>
|
||||
<td style="text-align: center;">
|
||||
<i class="fa fa-{{$al->active == 1?"check":""}}-square-o" aria-hidden="true"
|
||||
|
Loading…
Reference in New Issue
Block a user