diff --git a/Makefile b/Makefile
index 0ba982c6..1b3fe024 100644
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,6 @@ test:
vendor/bin/phpunit --testdox tests
schema:
- #php artisan infyom:scaffold Airlines --fieldsFile=database/schema/airlines.json
#php artisan infyom:scaffold Aircraft --fieldsFile=database/schema/aircraft.json
echo ""
diff --git a/app/Http/Controllers/RankingController.php b/app/Http/Controllers/RankingController.php
new file mode 100644
index 00000000..e534a3de
--- /dev/null
+++ b/app/Http/Controllers/RankingController.php
@@ -0,0 +1,156 @@
+rankingRepository = $rankingRepo;
+ }
+
+ /**
+ * Display a listing of the Ranking.
+ *
+ * @param Request $request
+ * @return Response
+ */
+ public function index(Request $request)
+ {
+ $this->rankingRepository->pushCriteria(new RequestCriteria($request));
+ $rankings = $this->rankingRepository->all();
+
+ return view('admin.rankings.index')
+ ->with('rankings', $rankings);
+ }
+
+ /**
+ * Show the form for creating a new Ranking.
+ *
+ * @return Response
+ */
+ public function create()
+ {
+ return view('admin.rankings.create');
+ }
+
+ /**
+ * Store a newly created Ranking in storage.
+ *
+ * @param CreateRankingRequest $request
+ *
+ * @return Response
+ */
+ public function store(CreateRankingRequest $request)
+ {
+ $input = $request->all();
+
+ $ranking = $this->rankingRepository->create($input);
+
+ Flash::success('Ranking saved successfully.');
+
+ return redirect(route('admin.rankings.index'));
+ }
+
+ /**
+ * Display the specified Ranking.
+ *
+ * @param int $id
+ *
+ * @return Response
+ */
+ public function show($id)
+ {
+ $ranking = $this->rankingRepository->findWithoutFail($id);
+
+ if (empty($ranking)) {
+ Flash::error('Ranking not found');
+
+ return redirect(route('admin.rankings.index'));
+ }
+
+ return view('admin.rankings.show')->with('ranking', $ranking);
+ }
+
+ /**
+ * Show the form for editing the specified Ranking.
+ *
+ * @param int $id
+ *
+ * @return Response
+ */
+ public function edit($id)
+ {
+ $ranking = $this->rankingRepository->findWithoutFail($id);
+
+ if (empty($ranking)) {
+ Flash::error('Ranking not found');
+
+ return redirect(route('admin.rankings.index'));
+ }
+
+ return view('admin.rankings.edit')->with('ranking', $ranking);
+ }
+
+ /**
+ * Update the specified Ranking in storage.
+ *
+ * @param int $id
+ * @param UpdateRankingRequest $request
+ *
+ * @return Response
+ */
+ public function update($id, UpdateRankingRequest $request)
+ {
+ $ranking = $this->rankingRepository->findWithoutFail($id);
+
+ if (empty($ranking)) {
+ Flash::error('Ranking not found');
+
+ return redirect(route('admin.rankings.index'));
+ }
+
+ $ranking = $this->rankingRepository->update($request->all(), $id);
+
+ Flash::success('Ranking updated successfully.');
+
+ return redirect(route('admin.rankings.index'));
+ }
+
+ /**
+ * Remove the specified Ranking from storage.
+ *
+ * @param int $id
+ *
+ * @return Response
+ */
+ public function destroy($id)
+ {
+ $ranking = $this->rankingRepository->findWithoutFail($id);
+
+ if (empty($ranking)) {
+ Flash::error('Ranking not found');
+
+ return redirect(route('admin.rankings.index'));
+ }
+
+ $this->rankingRepository->delete($id);
+
+ Flash::success('Ranking deleted successfully.');
+
+ return redirect(route('admin.rankings.index'));
+ }
+}
diff --git a/app/Http/Requests/CreateRankingRequest.php b/app/Http/Requests/CreateRankingRequest.php
new file mode 100644
index 00000000..b9cb8a40
--- /dev/null
+++ b/app/Http/Requests/CreateRankingRequest.php
@@ -0,0 +1,30 @@
+ 'string',
+ 'hours' => 'integer'
+ ];
+
+ /**
+ * Validation rules
+ *
+ * @var array
+ */
+ public static $rules = [
+
+ ];
+}
diff --git a/app/Repositories/RankingRepository.php b/app/Repositories/RankingRepository.php
new file mode 100644
index 00000000..a6d649da
--- /dev/null
+++ b/app/Repositories/RankingRepository.php
@@ -0,0 +1,24 @@
+increments('id');
+ $table->string('name');
+ $table->integer('hours')->default(0);
+ $table->bool('auto_approval_acars')->default(false);
+ $table->bool('auto_approval_manual')->default(false);
+ $table->bool('auto_promote')->default(true);
+ $table->timestamps();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('rankings');
+ }
+}
diff --git a/gulpfile.js b/gulpfile.js
index 04d503d8..a1ae8d4c 100755
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -17,3 +17,8 @@ elixir(mix => {
mix.sass('app.scss')
.webpack('app.js');
});
+
+
+gulp.task('reset', function() {
+ exec('php artisan migrate:refresh --seed --seeder DevelopmentSeeder');
+});
diff --git a/resources/views/admin/rankings/create.blade.php b/resources/views/admin/rankings/create.blade.php
new file mode 100644
index 00000000..62331897
--- /dev/null
+++ b/resources/views/admin/rankings/create.blade.php
@@ -0,0 +1,24 @@
+@extends('layouts.app')
+
+@section('content')
+
+ $MODEL_NAME_HUMAN$
+
+
{!! $ranking->id !!}
+{!! $ranking->name !!}
+{!! $ranking->hours !!}
+{!! $ranking->auto_approve_acars !!}
+{!! $ranking->auto_approve_manual !!}
+{!! $ranking->auto_promote !!}
+{!! $ranking->created_at !!}
+{!! $ranking->updated_at !!}
+| Name | +Hours | +Auto Approve Acars | +Auto Approve Manual | +Auto Promote | +Action | + + + @foreach($rankings as $ranking) +
|---|---|---|---|---|---|
| {!! $ranking->name !!} | +{!! $ranking->hours !!} | +{!! $ranking->auto_approve_acars !!} | +{!! $ranking->auto_approve_manual !!} | +{!! $ranking->auto_promote !!} | ++ {!! Form::open(['route' => ['admin.rankings.destroy', $ranking->$PRIMARY_KEY_NAME$], 'method' => 'delete']) !!} + + {!! Form::close() !!} + | +