allow setting of IATA code for airline

This commit is contained in:
Nabeel Shahzad
2017-07-22 23:03:39 -05:00
parent e9252b4e1c
commit 9a08586564
6 changed files with 18 additions and 1 deletions
@@ -13,7 +13,7 @@ class DashboardController extends BaseController
*/ */
public function index(Request $request) public function index(Request $request)
{ {
Feed::$cacheDir = storage_path(); Feed::$cacheDir = storage_path('app');
Feed::$cacheExpire = '5 hours'; Feed::$cacheExpire = '5 hours';
$feed = Feed::loadRss(config('phpvms.feed_url')); $feed = Feed::loadRss(config('phpvms.feed_url'));
+1
View File
@@ -16,6 +16,7 @@ class Airline extends Model
public $fillable = [ public $fillable = [
'code', 'code',
'iata',
'name', 'name',
'fuel_100ll_cost', 'fuel_100ll_cost',
'fuel_jeta_cost', 'fuel_jeta_cost',
@@ -16,6 +16,7 @@ class CreateAirlinesTable extends Migration
Schema::create('airlines', function (Blueprint $table) { Schema::create('airlines', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->string('code', 5); $table->string('code', 5);
$table->string('iata', 5);
$table->string('name', 50); $table->string('name', 50);
$table->string('country', 2)->nullable(); $table->string('country', 2)->nullable();
$table->boolean('active'); $table->boolean('active');
@@ -23,6 +24,9 @@ class CreateAirlinesTable extends Migration
$table->index('code'); $table->index('code');
$table->unique('code'); $table->unique('code');
$table->index('iata');
$table->unique('iata');
}); });
} }
@@ -4,6 +4,11 @@
{!! Form::text('code', null, ['class' => 'form-control']) !!} {!! Form::text('code', null, ['class' => 'form-control']) !!}
</div> </div>
<div class="form-group col-sm-6">
{!! Form::label('iata', 'IATA:') !!}
{!! Form::text('iata', null, ['class' => 'form-control']) !!}
</div>
<!-- Name Field --> <!-- Name Field -->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
{!! Form::label('name', 'Name:') !!} {!! Form::label('name', 'Name:') !!}
@@ -10,6 +10,11 @@
<p>{!! $airlines->code !!}</p> <p>{!! $airlines->code !!}</p>
</div> </div>
<div class="form-group">
{!! Form::label('iata', 'IATA:') !!}
<p>{!! $airlines->iata !!}</p>
</div>
<!-- Name Field --> <!-- Name Field -->
<div class="form-group"> <div class="form-group">
{!! Form::label('name', 'Name:') !!} {!! Form::label('name', 'Name:') !!}
@@ -1,6 +1,7 @@
<table class="table table-responsive" id="airlines-table"> <table class="table table-responsive" id="airlines-table">
<thead> <thead>
<th>Code</th> <th>Code</th>
<th>IATA</th>
<th>Name</th> <th>Name</th>
<th style="text-align: center;">Active</th> <th style="text-align: center;">Active</th>
<th colspan="3" style="text-align: right;">Action</th> <th colspan="3" style="text-align: right;">Action</th>
@@ -9,6 +10,7 @@
@foreach($airlines as $al) @foreach($airlines as $al)
<tr> <tr>
<td>{!! $al->code !!}</td> <td>{!! $al->code !!}</td>
<td>{!! $al->iata !!}</td>
<td>{!! $al->name !!}</td> <td>{!! $al->name !!}</td>
<td style="text-align: center;"> <td style="text-align: center;">
<i class="fa fa-{{$al->active == 1?"check":""}}-square-o" aria-hidden="true" <i class="fa fa-{{$al->active == 1?"check":""}}-square-o" aria-hidden="true"