From 61dc0a046d0c15f2052033cd64d2bcf2b9a664be Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Mon, 12 Feb 2018 10:26:27 -0600 Subject: [PATCH] Fix rank image field --- app/Http/Controllers/Admin/AircraftController.php | 4 ++-- resources/views/admin/aircraft/table.blade.php | 4 ++-- resources/views/admin/ranks/edit.blade.php | 6 +++--- resources/views/admin/ranks/fields.blade.php | 2 +- resources/views/admin/ranks/table.blade.php | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/Admin/AircraftController.php b/app/Http/Controllers/Admin/AircraftController.php index 682ce81b..89c2ea2f 100644 --- a/app/Http/Controllers/Admin/AircraftController.php +++ b/app/Http/Controllers/Admin/AircraftController.php @@ -52,10 +52,10 @@ class AircraftController extends BaseController public function store(CreateAircraftRequest $request) { $input = $request->all(); - $this->aircraftRepository->create($input); + $aircraft = $this->aircraftRepository->create($input); Flash::success('Aircraft saved successfully.'); - return redirect(route('admin.aircraft.index')); + return redirect(route('admin.aircraft.edit', ['id' => $aircraft->id])); } /** diff --git a/resources/views/admin/aircraft/table.blade.php b/resources/views/admin/aircraft/table.blade.php index d838e224..e084137b 100644 --- a/resources/views/admin/aircraft/table.blade.php +++ b/resources/views/admin/aircraft/table.blade.php @@ -1,7 +1,7 @@ - + {{----}} @@ -11,6 +11,7 @@ @foreach($aircraft as $ac) + - {{----}} @foreach($ranks as $rank) - +
Subfleet NameSubfleetICAORegistration Hours
{!! $ac->name !!} @if($ac->subfleet_id && $ac->subfleet) @@ -20,7 +21,6 @@ - @endif {!! $ac->name !!} {!! $ac->icao !!}{!! $ac->registration !!} diff --git a/resources/views/admin/ranks/edit.blade.php b/resources/views/admin/ranks/edit.blade.php index 52200626..b3154cd9 100644 --- a/resources/views/admin/ranks/edit.blade.php +++ b/resources/views/admin/ranks/edit.blade.php @@ -10,10 +10,10 @@
-
-

subfleets

-
+
+

subfleets

+
@include('admin.ranks.subfleets')
diff --git a/resources/views/admin/ranks/fields.blade.php b/resources/views/admin/ranks/fields.blade.php index 198457e3..add96ea6 100644 --- a/resources/views/admin/ranks/fields.blade.php +++ b/resources/views/admin/ranks/fields.blade.php @@ -16,7 +16,7 @@
{!! Form::label('image_link', 'Image Link:') !!} - {!! Form::input('image_link', null, ['class' => 'form-control']) !!} + {!! Form::text('image_link', null, ['class' => 'form-control']) !!}

{{ $errors->first('image_link') }}

diff --git a/resources/views/admin/ranks/table.blade.php b/resources/views/admin/ranks/table.blade.php index d920e1c3..b7176509 100644 --- a/resources/views/admin/ranks/table.blade.php +++ b/resources/views/admin/ranks/table.blade.php @@ -11,7 +11,7 @@
{!! $rank->name !!}{!! $rank->name !!} {!! $rank->hours !!} @if($rank->auto_approve_acars == 1)