#16 settings panel scaffolding
This commit is contained in:
@@ -38,6 +38,8 @@ tmp/
|
|||||||
.idea/**/dynamic.xml
|
.idea/**/dynamic.xml
|
||||||
.idea/**/uiDesigner.xml
|
.idea/**/uiDesigner.xml
|
||||||
|
|
||||||
|
phpvms_next.iml
|
||||||
|
|
||||||
# Gradle:
|
# Gradle:
|
||||||
.idea/**/gradle.xml
|
.idea/**/gradle.xml
|
||||||
.idea/**/libraries
|
.idea/**/libraries
|
||||||
|
|||||||
Generated
+9
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectCodeStyleSettingsManager">
|
||||||
|
<option name="PER_PROJECT_SETTINGS">
|
||||||
|
<value />
|
||||||
|
</option>
|
||||||
|
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default (1)" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="AircraftTest" type="PHPUnitRunConfigurationType" factoryName="PHPUnit" singleton="true">
|
||||||
|
<TestRunner class="AircraftTest" configuration_file="$PROJECT_DIR$/phpunit.xml" file="$PROJECT_DIR$/tests/AircraftTest.php" scope="Class" use_alternative_configuration_file="true" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
Generated
+8
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="XtextAutoBuilderState">
|
||||||
|
<installedLanguages>xtend;xtext</installedLanguages>
|
||||||
|
<index>rO0ABXNyADtvcmcuZWNsaXBzZS54dGV4dC5yZXNvdXJjZS5pbXBsLkNodW5rZWRSZXNvdXJjZURlc2NyaXB0aW9uc4nX+GBmyGixDAAAeHB3BAAAAAB4</index>
|
||||||
|
<module2generated>rO0ABXNyABFqYXZhLnV0aWwuSGFzaE1hcAUH2sHDFmDRAwACRgAKbG9hZEZhY3RvckkACXRocmVzaG9sZHhwP0AAAAAAAAx3CAAAABAAAAAAeA==</module2generated>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -17,11 +17,13 @@ build:
|
|||||||
install: db
|
install: db
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
reset:
|
clean:
|
||||||
-@rm database/testing.sqlite
|
|
||||||
@php artisan optimize
|
@php artisan optimize
|
||||||
@php artisan route:clear
|
@php artisan route:clear
|
||||||
@php artisan config:clear
|
@php artisan config:clear
|
||||||
|
@rm -f database/testing.sqlite
|
||||||
|
|
||||||
|
reset: clean
|
||||||
@sqlite3 database/testing.sqlite ""
|
@sqlite3 database/testing.sqlite ""
|
||||||
@php artisan migrate:refresh --seed --seeder DevelopmentSeeder
|
@php artisan migrate:refresh --seed --seeder DevelopmentSeeder
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Models\Setting;
|
||||||
|
use App\Http\Requests;
|
||||||
|
|
||||||
|
use Redirect;
|
||||||
|
use Titan\Controllers\TitanAdminController;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class SettingsController extends BaseController
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of setting.
|
||||||
|
*
|
||||||
|
* @return Response
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
return $this->view('admins.settings.index')->with('items', Setting::all());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified setting in storage.
|
||||||
|
*
|
||||||
|
* @param Setting $setting
|
||||||
|
* @param Request $request
|
||||||
|
* @return Response
|
||||||
|
*/
|
||||||
|
public function update(Setting $setting, Request $request)
|
||||||
|
{
|
||||||
|
$this->validate($request, Setting::$rules, Setting::$messages);
|
||||||
|
|
||||||
|
$this->updateEntry($setting, $request->all());
|
||||||
|
|
||||||
|
return redirect("/admin/settings");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -33,5 +33,9 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
$this->app->bind('App\Services\AircraftFareService', function($app) {
|
$this->app->bind('App\Services\AircraftFareService', function($app) {
|
||||||
return new \App\Services\AircraftFareService();
|
return new \App\Services\AircraftFareService();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (in_array($this->app->environment(), ['local', 'dev', 'unittest'])) {
|
||||||
|
$this->app->register(\Bpocallaghan\Generators\GeneratorsServiceProvider::class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-1
@@ -8,6 +8,7 @@
|
|||||||
"php": ">=7.0",
|
"php": ">=7.0",
|
||||||
"laravel/framework": "5.4.*",
|
"laravel/framework": "5.4.*",
|
||||||
"barryvdh/laravel-ide-helper": "^2.1",
|
"barryvdh/laravel-ide-helper": "^2.1",
|
||||||
|
"yajra/laravel-datatables-oracle": "~6.0",
|
||||||
"infyomlabs/laravel-generator": "dev-master",
|
"infyomlabs/laravel-generator": "dev-master",
|
||||||
"laravelcollective/html": "5.4.x",
|
"laravelcollective/html": "5.4.x",
|
||||||
"infyomlabs/adminlte-templates": "5.3.x-dev",
|
"infyomlabs/adminlte-templates": "5.3.x-dev",
|
||||||
@@ -28,7 +29,8 @@
|
|||||||
"phpunit/phpunit": "~5.7",
|
"phpunit/phpunit": "~5.7",
|
||||||
"symfony/css-selector": "3.1.*",
|
"symfony/css-selector": "3.1.*",
|
||||||
"symfony/dom-crawler": "3.1.*",
|
"symfony/dom-crawler": "3.1.*",
|
||||||
"laravel/homestead": "^5.4"
|
"laravel/homestead": "^5.4",
|
||||||
|
"bpocallaghan/generators": "^4.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"classmap": [
|
"classmap": [
|
||||||
|
|||||||
Generated
+641
-601
File diff suppressed because it is too large
Load Diff
+49
-1
@@ -2,7 +2,20 @@
|
|||||||
<module type="WEB_MODULE" version="4">
|
<module type="WEB_MODULE" version="4">
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
<exclude-output />
|
<exclude-output />
|
||||||
<content url="file://$MODULE_DIR$" />
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/bpocallaghan/generators" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/dompdf/dompdf" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/jeremeamia/SuperClosure" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/league/fractal" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/maatwebsite/excel" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/nikic/php-parser" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phenx/php-font-lib" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phenx/php-svg-lib" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phpoffice/phpexcel" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php56" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-util" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/yajra/laravel-datatables-oracle" />
|
||||||
|
</content>
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="module-library">
|
<orderEntry type="module-library">
|
||||||
<library name="PHARS">
|
<library name="PHARS">
|
||||||
@@ -15,5 +28,40 @@
|
|||||||
</SOURCES>
|
</SOURCES>
|
||||||
</library>
|
</library>
|
||||||
</orderEntry>
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="PHP" type="php">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="file://$APPLICATION_HOME_DIR$/bin" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/bpocallaghan/generators" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/dompdf/dompdf" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/jeremeamia/SuperClosure" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/league/fractal" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/maatwebsite/excel" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/nikic/php-parser" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/phenx/php-font-lib" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/phenx/php-svg-lib" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/phpoffice/phpexcel" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/symfony/polyfill-php56" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/symfony/polyfill-util" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/yajra/laravel-datatables-oracle" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES>
|
||||||
|
<root url="file://$APPLICATION_HOME_DIR$/bin" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/bpocallaghan/generators" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/dompdf/dompdf" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/jeremeamia/SuperClosure" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/league/fractal" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/maatwebsite/excel" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/nikic/php-parser" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/phenx/php-font-lib" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/phenx/php-svg-lib" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/phpoffice/phpexcel" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/symfony/polyfill-php56" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/symfony/polyfill-util" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/yajra/laravel-datatables-oracle" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
@extends('admin.app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<section class="content-header">
|
||||||
|
<h1 class="pull-left">Settings</h1>
|
||||||
|
{{--<h1 class="pull-right">
|
||||||
|
<a class="btn btn-primary pull-right" style="margin-top: -10px;margin-bottom: 5px" href="{!! route('admin.settings.create') !!}">Add New</a>
|
||||||
|
</h1>--}}
|
||||||
|
</section>
|
||||||
|
<div class="content">
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
|
||||||
|
@include('flash::message')
|
||||||
|
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
<div class="box box-primary">
|
||||||
|
<div class="box-body">
|
||||||
|
@include('admin.settings.table')
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<table class="table table-responsive" id="settings-table">
|
||||||
|
<thead>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Value</th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($settings as $s)
|
||||||
|
<tr>
|
||||||
|
<td>{!! $s->key !!}</td>
|
||||||
|
<td>{!! $s->value !!}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
+11
-11
@@ -5,8 +5,7 @@ Route::get('/home', 'HomeController@index');
|
|||||||
|
|
||||||
|
|
||||||
Route::group([
|
Route::group([
|
||||||
'namespace' => 'Frontend',
|
'namespace' => 'Frontend', 'prefix' => 'frontend', 'as' => 'frontend.',
|
||||||
'as' => 'frontend.',
|
|
||||||
'middleware' => ['role:admin|user'],
|
'middleware' => ['role:admin|user'],
|
||||||
], function () {
|
], function () {
|
||||||
Route::resource('dashboard', 'DashboardController');
|
Route::resource('dashboard', 'DashboardController');
|
||||||
@@ -19,9 +18,7 @@ Auth::routes();
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
Route::group([
|
Route::group([
|
||||||
'namespace' => 'Admin',
|
'namespace' => 'Admin', 'prefix' => 'admin', 'as' => 'admin.',
|
||||||
'prefix' => 'admin',
|
|
||||||
'as' => 'admin.',
|
|
||||||
'middleware' => ['role:admin'],
|
'middleware' => ['role:admin'],
|
||||||
], function () {
|
], function () {
|
||||||
Route::resource('airports', 'AirportController');
|
Route::resource('airports', 'AirportController');
|
||||||
@@ -29,16 +26,19 @@ Route::group([
|
|||||||
Route::resource('aircraftclasses', 'AircraftClassController');
|
Route::resource('aircraftclasses', 'AircraftClassController');
|
||||||
Route::resource('fares', 'FareController');
|
Route::resource('fares', 'FareController');
|
||||||
|
|
||||||
|
# aircraft and fare associations
|
||||||
Route::resource('aircraft', 'AircraftController');
|
Route::resource('aircraft', 'AircraftController');
|
||||||
Route::match(['get', 'post', 'put', 'delete'],
|
Route::match(['get', 'post', 'put', 'delete'], 'aircraft/{id}/fares', 'AircraftController@fares');
|
||||||
'aircraft/{id}/fares',
|
|
||||||
'AircraftController@fares');
|
|
||||||
|
|
||||||
|
# flights and aircraft associations
|
||||||
Route::resource('flights', 'FlightController');
|
Route::resource('flights', 'FlightController');
|
||||||
Route::match(['get', 'post', 'put', 'delete'],
|
Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/aircraft', 'FlightController@aircraft');
|
||||||
'flights/{id}/aircraft',
|
|
||||||
'FlightController@aircraft');
|
|
||||||
|
|
||||||
|
# view/update settings
|
||||||
|
Route::match(['get'], 'settings', 'SettingsController@index');
|
||||||
|
Route::match(['post', 'put'], 'settings', 'SettingsController@update');
|
||||||
|
|
||||||
|
# defaults
|
||||||
Route::get('', ['uses' => 'DashboardController@index']);
|
Route::get('', ['uses' => 'DashboardController@index']);
|
||||||
Route::get('/', ['uses' => 'DashboardController@index']);
|
Route::get('/', ['uses' => 'DashboardController@index']);
|
||||||
Route::get('/dashboard', ['uses' => 'DashboardController@index','name' => 'dashboard']);
|
Route::get('/dashboard', ['uses' => 'DashboardController@index','name' => 'dashboard']);
|
||||||
|
|||||||
Reference in New Issue
Block a user