rename 'enabled' to 'active'

This commit is contained in:
Nabeel Shahzad 2017-06-08 20:46:50 -05:00
parent 3678363766
commit 0cb98f1920
10 changed files with 28 additions and 33 deletions

View File

@ -20,7 +20,7 @@ class Airlines extends Model
public $fillable = [
'code',
'name',
'enabled'
'active'
];
/**
@ -31,7 +31,7 @@ class Airlines extends Model
protected $casts = [
'code' => 'string',
'name' => 'string',
'enabled' => 'boolean'
'active' => 'boolean'
];
/**

View File

@ -17,7 +17,7 @@ class CreateAirlinesTable extends Migration
$table->increments('id');
$table->string('code');
$table->string('name');
$table->boolean('enabled');
$table->boolean('active');
$table->timestamps();
$table->softDeletes();
});

View File

@ -1,4 +1,4 @@
@extends('layouts.admin.app')
@extends('admin.app')
@section('content')
<section class="content-header">

View File

@ -10,12 +10,12 @@
{!! Form::text('name', null, ['class' => 'form-control']) !!}
</div>
<!-- Enabled Field -->
<!-- Active Field -->
<div class="form-group col-sm-6">
{!! Form::label('enabled', 'Enabled:') !!}
{!! Form::label('active', 'Active:') !!}
<label class="checkbox-inline">
{!! Form::hidden('enabled', false) !!}
{!! Form::checkbox('enabled', 'True', null) !!} 1
{!! Form::hidden('active', false) !!}
{!! Form::checkbox('active', 'True', null) !!} 1
</label>
</div>

View File

@ -1,4 +1,4 @@
@extends('layouts.admin.app')
@extends('admin.app')
@section('content')
<section class="content-header">

View File

@ -1,4 +1,4 @@
@extends('layouts.admin.app')
@extends('admin.app')
@section('content')
<section class="content-header">

View File

@ -16,10 +16,10 @@
<p>{!! $airlines->name !!}</p>
</div>
<!-- Enabled Field -->
<!-- Active Field -->
<div class="form-group">
{!! Form::label('enabled', 'Enabled:') !!}
<p>{!! $airlines->enabled !!}</p>
{!! Form::label('active', 'Active:') !!}
<p>{!! $airlines->active !!}</p>
</div>
<!-- Created At Field -->

View File

@ -2,20 +2,20 @@
<thead>
<th>Code</th>
<th>Name</th>
<th>Enabled</th>
<th>Active?</th>
<th colspan="3">Action</th>
</thead>
<tbody>
@foreach($airlines as $airlines)
@foreach($airlines as $al)
<tr>
<td>{!! $airlines->code !!}</td>
<td>{!! $airlines->name !!}</td>
<td>{!! $airlines->enabled !!}</td>
<td>{!! $al->code !!}</td>
<td>{!! $al->name !!}</td>
<td>{!! $al->active !!}</td>
<td>
{!! Form::open(['route' => ['airlines.destroy', $airlines->id], 'method' => 'delete']) !!}
{!! Form::open(['route' => ['airlines.destroy', $al->id], 'method' => 'delete']) !!}
<div class='btn-group'>
<a href="{!! route('airlines.show', [$airlines->id]) !!}" class='btn btn-default btn-xs'><i class="glyphicon glyphicon-eye-open"></i></a>
<a href="{!! route('airlines.edit', [$airlines->id]) !!}" class='btn btn-default btn-xs'><i class="glyphicon glyphicon-edit"></i></a>
<a href="{!! route('airlines.show', [$al->id]) !!}" class='btn btn-default btn-xs'><i class="glyphicon glyphicon-eye-open"></i></a>
<a href="{!! route('airlines.edit', [$al->id]) !!}" class='btn btn-default btn-xs'><i class="glyphicon glyphicon-edit"></i></a>
{!! Form::button('<i class="glyphicon glyphicon-trash"></i>', ['type' => 'submit', 'class' => 'btn btn-danger btn-xs', 'onclick' => "return confirm('Are you sure?')"]) !!}
</div>
{!! Form::close() !!}
@ -23,4 +23,4 @@
</tr>
@endforeach
</tbody>
</table>
</table>

View File

@ -25,7 +25,7 @@
<!-- Logo -->
<a href="#" class="logo">
<b>phpVMS<sup>nxt</sup></b>
<b>phpvms<sup>next</sup></b>
</a>
<!-- Header Navbar -->

View File

@ -19,11 +19,15 @@ Route::get('/', function () {
Route::get('/home', 'HomeController@index');
//Auth::routes();
/**
* Admin routes
*/
Route::get('/admin', function () {
return redirect('/admin/airlines');
});
Route::group([
'namespace' => 'Admin',
'middleware' => 'auth',
@ -31,15 +35,6 @@ Route::group([
], function () {
Route::resource('airlines', 'AirlinesController');
Route::resource('aircraft', 'AircraftController');
// Route::get('admin/aircrafts', ['as'=> 'admin.aircrafts.index', 'uses' => 'AircraftController@index']);
// Route::post('admin/aircrafts', ['as'=> 'admin.aircrafts.store', 'uses' => 'AircraftController@store']);
// Route::get('admin/aircrafts/create', ['as'=> 'admin.aircrafts.create', 'uses' => 'AircraftController@create']);
// Route::put('admin/aircrafts/{aircrafts}', ['as'=> 'admin.aircrafts.update', 'uses' => 'AircraftController@update']);
// Route::patch('admin/aircrafts/{aircrafts}', ['as'=> 'admin.aircrafts.update', 'uses' => 'AircraftController@update']);
// Route::delete('admin/aircrafts/{aircrafts}', ['as'=> 'admin.aircrafts.destroy', 'uses' => 'AircraftController@destroy']);
// Route::get('admin/aircrafts/{aircrafts}', ['as'=> 'admin.aircrafts.show', 'uses' => 'AircraftController@show']);
// Route::get('admin/aircrafts/{aircrafts}/edit', ['as'=> 'admin.aircrafts.edit', 'uses' => 'AircraftController@edit']);
});