diff --git a/app/Http/Controllers/Admin/AircraftController.php b/app/Http/Controllers/Admin/AircraftController.php
new file mode 100644
index 00000000..2412a055
--- /dev/null
+++ b/app/Http/Controllers/Admin/AircraftController.php
@@ -0,0 +1,123 @@
+aircraftRepository = $aircraftRepo;
+ }
+
+ /**
+ * Display a listing of the Aircraft.
+ */
+ public function index(Request $request)
+ {
+ $this->aircraftRepository->pushCriteria(new RequestCriteria($request));
+ $aircraft = $this->aircraftRepository->all();
+
+ return view('admin.aircraft.index')
+ ->with('aircraft', $aircraft);
+ }
+
+ /**
+ * Show the form for creating a new Aircraft.
+ */
+ public function create()
+ {
+ return view('admin.aircraft.create');
+ }
+
+ /**
+ * Store a newly created Aircraft in storage.
+ */
+ public function store(CreateAircraftRequest $request)
+ {
+ $input = $request->all();
+
+ $aircraft = $this->aircraftRepository->create($input);
+
+ Flash::success('Aircraft saved successfully.');
+ return redirect(route('admin.aircraft.index'));
+ }
+
+ /**
+ * Display the specified Aircraft.
+ */
+ public function show($id)
+ {
+ $aircraft = $this->aircraftRepository->findWithoutFail($id);
+
+ if (empty($aircraft)) {
+ Flash::error('Aircraft not found');
+ return redirect(route('admin.aircraft.index'));
+ }
+
+ return view('admin.aircraft.show')->with('aircraft', $aircraft);
+ }
+
+ /**
+ * Show the form for editing the specified Aircraft.
+ */
+ public function edit($id)
+ {
+ $aircraft = $this->aircraftRepository->findWithoutFail($id);
+
+ if (empty($aircraft)) {
+ Flash::error('Aircraft not found');
+ return redirect(route('admin.aircraft.index'));
+ }
+
+ return view('admin.aircraft.edit')->with('aircraft', $aircraft);
+ }
+
+ /**
+ * Update the specified Aircraft in storage.
+ */
+ public function update($id, UpdateAircraftRequest $request)
+ {
+ $aircraft = $this->aircraftRepository->findWithoutFail($id);
+
+ if (empty($aircraft)) {
+ Flash::error('Aircraft not found');
+ return redirect(route('admin.aircraft.index'));
+ }
+
+ $aircraft = $this->aircraftRepository->update($request->all(), $id);
+
+ Flash::success('Aircraft updated successfully.');
+
+ return redirect(route('admin.aircraft.index'));
+ }
+
+ /**
+ * Remove the specified Aircraft from storage.
+ */
+ public function destroy($id)
+ {
+ $aircraft = $this->aircraftRepository->findWithoutFail($id);
+
+ if (empty($aircraft)) {
+ Flash::error('Aircraft not found');
+ return redirect(route('admin.aircraft.index'));
+ }
+
+ $this->aircraftRepository->delete($id);
+
+ Flash::success('Aircraft deleted successfully.');
+
+ return redirect(route('admin.aircraft.index'));
+ }
+}
diff --git a/app/Http/Requests/CreateAircraftRequest.php b/app/Http/Requests/CreateAircraftRequest.php
new file mode 100644
index 00000000..4501c0f5
--- /dev/null
+++ b/app/Http/Requests/CreateAircraftRequest.php
@@ -0,0 +1,30 @@
+ 'string',
+ 'name' => 'string',
+ 'full_name' => 'string',
+ 'registration' => 'string',
+ 'active' => 'boolean',
+ ];
+
+ /**
+ * Validation rules
+ *
+ * @var array
+ */
+ public static $rules = [
+ 'icao' => 'required|max:4',
+ 'name' => 'required',
+ 'full_name' => 'required',
+ 'registration' => 'required',
+ ];
+}
diff --git a/app/Repositories/AircraftRepository.php b/app/Repositories/AircraftRepository.php
new file mode 100644
index 00000000..468e23c8
--- /dev/null
+++ b/app/Repositories/AircraftRepository.php
@@ -0,0 +1,28 @@
+increments('id');
+ $table->string('icao');
+ $table->string('name');
+ $table->string('full_name')->nullable();
+ $table->string('registration')->nullable();
+ $table->boolean('active');
+ $table->timestamps();
+ $table->softDeletes();
+ });
+ }
+
+ public function down()
+ {
+ Schema::drop('aircraft');
+ }
+}
diff --git a/resources/views/admin/aircraft/create.blade.php b/resources/views/admin/aircraft/create.blade.php
new file mode 100644
index 00000000..8d27dceb
--- /dev/null
+++ b/resources/views/admin/aircraft/create.blade.php
@@ -0,0 +1,24 @@
+@extends('admin.app')
+
+@section('content')
+
+ Aircraft
+
+
{!! $aircraft->id !!}
+{!! $aircraft->icao !!}
+{!! $aircraft->name !!}
+{!! $aircraft->full_name !!}
+{!! $aircraft->registration !!}
+{!! $aircraft->active !!}
+{!! $aircraft->created_at !!}
+{!! $aircraft->updated_at !!}
+| ICAO | +Name | +Registration | +Active | +Action | + + + @foreach($aircraft as $ac) +
|---|---|---|---|---|
| {!! $ac->icao !!} | +{!! $ac->name !!} | +{!! $ac->registration !!} | +{!! $ac->active !!} | ++ {!! Form::open(['route' => ['admin.aircraft.destroy', $ac->id], 'method' => 'delete']) !!} + + {!! Form::close() !!} + | +