#355 Calculate distance button (#366)

* #355 Calculate distance button in add/edit Flight page

* Styling

* Move add/edit flight logic out of controller and into service layer

* Styling

* Formatting

* Run styleci against modules dir

* Styleci config

* Style fixes in /modules
This commit is contained in:
Nabeel S
2019-08-26 12:32:46 -04:00
committed by GitHub
parent 25999d55a3
commit bbec276da8
57 changed files with 9819 additions and 7522 deletions

View File

@@ -3,8 +3,8 @@
namespace Modules\Sample\Providers;
use App\Services\ModuleService;
use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Factory;
use Illuminate\Support\ServiceProvider;
use Route;
class SampleServiceProvider extends ServiceProvider
@@ -26,7 +26,7 @@ class SampleServiceProvider extends ServiceProvider
$this->registerLinks();
$this->registerFactories();
$this->loadMigrationsFrom(__DIR__ . '/../Database/migrations');
$this->loadMigrationsFrom(__DIR__.'/../Database/migrations');
}
/**
@@ -54,43 +54,43 @@ class SampleServiceProvider extends ServiceProvider
*/
protected function registerRoutes()
{
/**
/*
* Routes for the frontend
*/
Route::group([
'as' => 'sample.',
'as' => 'sample.',
'prefix' => 'sample',
// If you want a RESTful module, change this to 'api'
'middleware' => ['web'],
'namespace' => 'Modules\Sample\Http\Controllers'
], function() {
$this->loadRoutesFrom(__DIR__ . '/../Http/Routes/web.php');
'namespace' => 'Modules\Sample\Http\Controllers',
], function () {
$this->loadRoutesFrom(__DIR__.'/../Http/Routes/web.php');
});
/**
/*
* Routes for the admin
*/
Route::group([
'as' => 'sample.',
'as' => 'sample.',
'prefix' => 'admin/sample',
// If you want a RESTful module, change this to 'api'
'middleware' => ['web', 'role:admin'],
'namespace' => 'Modules\Sample\Http\Controllers\Admin'
], function() {
$this->loadRoutesFrom(__DIR__ . '/../Http/Routes/admin.php');
'namespace' => 'Modules\Sample\Http\Controllers\Admin',
], function () {
$this->loadRoutesFrom(__DIR__.'/../Http/Routes/admin.php');
});
/**
/*
* Routes for an API
*/
Route::group([
'as' => 'sample.',
'as' => 'sample.',
'prefix' => 'api/sample',
// If you want a RESTful module, change this to 'api'
'middleware' => ['api'],
'namespace' => 'Modules\Sample\Http\Controllers\Api'
], function() {
$this->loadRoutesFrom(__DIR__ . '/../Http/Routes/api.php');
'namespace' => 'Modules\Sample\Http\Controllers\Api',
], function () {
$this->loadRoutesFrom(__DIR__.'/../Http/Routes/api.php');
});
}
@@ -117,8 +117,8 @@ class SampleServiceProvider extends ServiceProvider
$sourcePath = __DIR__.'/../Resources/views';
$this->publishes([
$sourcePath => $viewPath
],'views');
$sourcePath => $viewPath,
], 'views');
$paths = array_map(
function ($path) {
@@ -141,18 +141,19 @@ class SampleServiceProvider extends ServiceProvider
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, 'sample');
} else {
$this->loadTranslationsFrom(__DIR__ .'/../Resources/lang', 'sample');
$this->loadTranslationsFrom(__DIR__.'/../Resources/lang', 'sample');
}
}
/**
* Register an additional directory of factories.
*
* @source https://github.com/sebastiaanluca/laravel-resource-flow/blob/develop/src/Modules/ModuleServiceProvider.php#L66
*/
public function registerFactories()
{
if (! app()->environment('production')) {
app(Factory::class)->load(__DIR__ . '/../Database/factories');
if (!app()->environment('production')) {
app(Factory::class)->load(__DIR__.'/../Database/factories');
}
}