Skip to content

Commit

Permalink
allow setting of IATA code for airline
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeelio committed Jul 23, 2017
1 parent e9252b4 commit 9a08586
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
1 change: 1 addition & 0 deletions app/Models/Airline.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Airline extends Model

public $fillable = [
'code',
'iata',
'name',
'fuel_100ll_cost',
'fuel_jeta_cost',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ public function up()
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');
$table->timestamps();

$table->index('code');
$table->unique('code');

$table->index('iata');
$table->unique('iata');
});
}

Expand Down
5 changes: 5 additions & 0 deletions resources/views/admin/airlines/fields.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:') !!}
Expand Down
5 changes: 5 additions & 0 deletions resources/views/admin/airlines/show_fields.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:') !!}
Expand Down
2 changes: 2 additions & 0 deletions resources/views/admin/airlines/table.blade.php
Original file line number Diff line number Diff line change
@@ -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>
Expand All @@ -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"
Expand Down

0 comments on commit 9a08586

Please sign in to comment.