pare down the vacentral module
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'name' => 'Vacentral'
|
'name' => 'vacentral'
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Modules\Vacentral\Database\Seeders;
|
|
||||||
|
|
||||||
use Illuminate\Database\Seeder;
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
|
|
||||||
class VacentralDatabaseSeeder extends Seeder
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the database seeds.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
Model::unguard();
|
|
||||||
|
|
||||||
// $this->call("OthersTableSeeder");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Modules\Vacentral\Http\Controllers;
|
|
||||||
|
|
||||||
use App\Http\Controllers\AppBaseController;
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
|
|
||||||
|
|
||||||
class AdminController extends AppBaseController
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Display a listing of the resource.
|
|
||||||
*/
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
return view('vacentral::admin.index');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for creating a new resource.
|
|
||||||
*/
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
return view('vacentral::admin.create');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Store a newly created resource in storage.
|
|
||||||
*/
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the specified resource.
|
|
||||||
*/
|
|
||||||
public function show()
|
|
||||||
{
|
|
||||||
return view('vacentral::admin.show');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for editing the specified resource.
|
|
||||||
*/
|
|
||||||
public function edit()
|
|
||||||
{
|
|
||||||
return view('vacentral::admin.edit');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the specified resource in storage.
|
|
||||||
*/
|
|
||||||
public function update(Request $request)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the specified resource from storage.
|
|
||||||
*/
|
|
||||||
public function destroy()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Modules\Vacentral\Http\Controllers;
|
|
||||||
|
|
||||||
use App\Http\Controllers\AppBaseController;
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
|
|
||||||
|
|
||||||
class VacentralController extends AppBaseController
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Display a listing of the resource.
|
|
||||||
*/
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
return view('vacentral::index');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for creating a new resource.
|
|
||||||
*/
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
return view('vacentral::create');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Store a newly created resource in storage.
|
|
||||||
* @param Request $request
|
|
||||||
*/
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the specified resource.
|
|
||||||
*/
|
|
||||||
public function show()
|
|
||||||
{
|
|
||||||
return view('vacentral::show');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for editing the specified resource.
|
|
||||||
*/
|
|
||||||
public function edit()
|
|
||||||
{
|
|
||||||
return view('vacentral::edit');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the specified resource in storage.
|
|
||||||
*/
|
|
||||||
public function update(Request $request)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the specified resource from storage.
|
|
||||||
*/
|
|
||||||
public function destroy()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
Route::group(['middleware' => [
|
|
||||||
'role:admin|user' # leave blank to make this public
|
|
||||||
]], function() {
|
|
||||||
|
|
||||||
# all your routes are prefixed with the above prefix
|
|
||||||
# e.g. yoursite.com/sample
|
|
||||||
Route::get('/', 'VacentralController@index');
|
|
||||||
|
|
||||||
# This is the admin path. Comment this out if you don't have
|
|
||||||
# an admin panel component.
|
|
||||||
Route::group([
|
|
||||||
'middleware' => ['role:admin'],
|
|
||||||
], function () {
|
|
||||||
Route::get('/admin', 'AdminController@index');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
16
modules/Vacentral/Listeners/PirepAcceptedEventListener.php
Normal file
16
modules/Vacentral/Listeners/PirepAcceptedEventListener.php
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Vacentral\Listeners;
|
||||||
|
|
||||||
|
use App\Events\PirepAccepted;
|
||||||
|
use Log;
|
||||||
|
|
||||||
|
class PirepAcceptedEventListener
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Handle the event.
|
||||||
|
*/
|
||||||
|
public function handle(PirepAccepted $pirep) {
|
||||||
|
Log::info('Received PIREP accepted event', [$pirep]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Modules\Vacentral\Listeners;
|
|
||||||
|
|
||||||
use App\Events\TestEvent;
|
|
||||||
use Log;
|
|
||||||
|
|
||||||
class TestEventListener
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Handle the event.
|
|
||||||
*/
|
|
||||||
public function handle(TestEvent $event) {
|
|
||||||
Log::info('Received event', [$event]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
37
modules/Vacentral/Providers/AppServiceProvider.php
Normal file
37
modules/Vacentral/Providers/AppServiceProvider.php
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Vacentral\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Illuminate\Database\Eloquent\Factory;
|
||||||
|
use Route;
|
||||||
|
|
||||||
|
|
||||||
|
class AppServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
protected $defer = false;
|
||||||
|
protected $moduleSvc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Boot the application events.
|
||||||
|
*/
|
||||||
|
public function boot()
|
||||||
|
{
|
||||||
|
$this->moduleSvc = app('App\Services\ModuleService');
|
||||||
|
$this->registerConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register config.
|
||||||
|
*/
|
||||||
|
protected function registerConfig()
|
||||||
|
{
|
||||||
|
$this->publishes([
|
||||||
|
__DIR__.'/../Config/config.php' => config_path('vacentral.php'),
|
||||||
|
], 'config');
|
||||||
|
|
||||||
|
$this->mergeConfigFrom(
|
||||||
|
__DIR__.'/../Config/config.php', 'vacentral'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,8 +2,9 @@
|
|||||||
|
|
||||||
namespace Modules\Vacentral\Providers;
|
namespace Modules\Vacentral\Providers;
|
||||||
|
|
||||||
|
use App\Events\PirepAccepted;
|
||||||
use App\Events\TestEvent;
|
use App\Events\TestEvent;
|
||||||
use Modules\Vacentral\Listeners\TestEventListener;
|
use Modules\Vacentral\Listeners\PirepAcceptedEventListener;
|
||||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||||
|
|
||||||
class EventServiceProvider extends ServiceProvider
|
class EventServiceProvider extends ServiceProvider
|
||||||
@@ -12,7 +13,7 @@ class EventServiceProvider extends ServiceProvider
|
|||||||
* The event listener mappings for the application.
|
* The event listener mappings for the application.
|
||||||
*/
|
*/
|
||||||
protected $listen = [
|
protected $listen = [
|
||||||
TestEvent::class => [TestEventListener::class],
|
PirepAccepted::class => [PirepAcceptedEventListener::class],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,132 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Modules\Vacentral\Providers;
|
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
|
||||||
use Illuminate\Database\Eloquent\Factory;
|
|
||||||
use Route;
|
|
||||||
|
|
||||||
|
|
||||||
class VacentralServiceProvider extends ServiceProvider
|
|
||||||
{
|
|
||||||
protected $defer = false;
|
|
||||||
protected $moduleSvc;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Boot the application events.
|
|
||||||
*/
|
|
||||||
public function boot()
|
|
||||||
{
|
|
||||||
$this->moduleSvc = app('App\Services\ModuleService');
|
|
||||||
|
|
||||||
$this->registerRoutes();
|
|
||||||
$this->registerTranslations();
|
|
||||||
$this->registerConfig();
|
|
||||||
$this->registerViews();
|
|
||||||
|
|
||||||
$this->registerLinks();
|
|
||||||
|
|
||||||
$this->registerFactories();
|
|
||||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/migrations');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register the service provider.
|
|
||||||
*/
|
|
||||||
public function register()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add module links here
|
|
||||||
*/
|
|
||||||
public function registerLinks()
|
|
||||||
{
|
|
||||||
// Show this link if logged in
|
|
||||||
// $this->moduleSvc->addFrontendLink('Vacentral', '/vacentral', '', $logged_in=true);
|
|
||||||
|
|
||||||
// Admin links:
|
|
||||||
$this->moduleSvc->addAdminLink('Vacentral', '/vacentral/admin');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register the routes
|
|
||||||
*/
|
|
||||||
protected function registerRoutes()
|
|
||||||
{
|
|
||||||
Route::group([
|
|
||||||
'as' => 'vacentral.',
|
|
||||||
'prefix' => 'vacentral',
|
|
||||||
// If you want a RESTful module, change this to 'api'
|
|
||||||
'middleware' => ['web'],
|
|
||||||
'namespace' => 'Modules\Vacentral\Http\Controllers'
|
|
||||||
], function() {
|
|
||||||
$this->loadRoutesFrom(__DIR__ . '/../Http/routes.php');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register config.
|
|
||||||
*/
|
|
||||||
protected function registerConfig()
|
|
||||||
{
|
|
||||||
$this->publishes([
|
|
||||||
__DIR__.'/../Config/config.php' => config_path('vacentral.php'),
|
|
||||||
], 'config');
|
|
||||||
|
|
||||||
$this->mergeConfigFrom(
|
|
||||||
__DIR__.'/../Config/config.php', 'vacentral'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register views.
|
|
||||||
*/
|
|
||||||
public function registerViews()
|
|
||||||
{
|
|
||||||
$viewPath = resource_path('views/modules/vacentral');
|
|
||||||
$sourcePath = __DIR__.'/../Resources/views';
|
|
||||||
|
|
||||||
$this->publishes([
|
|
||||||
$sourcePath => $viewPath
|
|
||||||
],'views');
|
|
||||||
|
|
||||||
$this->loadViewsFrom(array_merge(array_map(function ($path) {
|
|
||||||
return $path . '/modules/vacentral';
|
|
||||||
}, \Config::get('view.paths')), [$sourcePath]), 'vacentral');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register translations.
|
|
||||||
*/
|
|
||||||
public function registerTranslations()
|
|
||||||
{
|
|
||||||
$langPath = resource_path('lang/modules/vacentral');
|
|
||||||
|
|
||||||
if (is_dir($langPath)) {
|
|
||||||
$this->loadTranslationsFrom($langPath, 'vacentral');
|
|
||||||
} else {
|
|
||||||
$this->loadTranslationsFrom(__DIR__ .'/../Resources/lang', 'vacentral');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the services provided by the provider.
|
|
||||||
*/
|
|
||||||
public function provides()
|
|
||||||
{
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
@extends('vacentral::layouts.admin')
|
|
||||||
|
|
||||||
@section('title', 'Vacentral')
|
|
||||||
@section('actions')
|
|
||||||
<li>
|
|
||||||
<a href="{!! url('/vacentral/admin/create') !!}">
|
|
||||||
<i class="ti-plus"></i>
|
|
||||||
Add New</a>
|
|
||||||
</li>
|
|
||||||
@endsection
|
|
||||||
@section('content')
|
|
||||||
<div class="card border-blue-bottom">
|
|
||||||
<div class="header"><h4 class="title">Admin Scaffold!</h4></div>
|
|
||||||
<div class="content">
|
|
||||||
<p>This view is loaded from module: {!! config('vacentral.name') !!}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endsection
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
@extends('vacentral::layouts.frontend')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
<h1>Hello World</h1>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
This view is loaded from module: {!! config('vacentral.name') !!}
|
|
||||||
</p>
|
|
||||||
@endsection
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
{{--
|
|
||||||
You probably don't want to edit anything here. Just make
|
|
||||||
sure to extend this in your views. It will pass the content section through
|
|
||||||
--}}
|
|
||||||
@extends('admin.app')
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
{{--
|
|
||||||
You probably don't want to edit anything here. Just make
|
|
||||||
sure to extend this in your views. It will pass the content section through
|
|
||||||
--}}
|
|
||||||
@extends('layouts.' . config('phpvms.skin') . '.app')
|
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
"extra": {
|
"extra": {
|
||||||
"laravel": {
|
"laravel": {
|
||||||
"providers": [
|
"providers": [
|
||||||
"Modules\\Vacentral\\Providers\\VacentralServiceProvider",
|
"Modules\\Vacentral\\Providers\\AppServiceProvider",
|
||||||
"Modules\\Vacentral\\Providers\\EventServiceProvider"
|
"Modules\\Vacentral\\Providers\\EventServiceProvider"
|
||||||
],
|
],
|
||||||
"aliases": {
|
"aliases": {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"active": 1,
|
"active": 1,
|
||||||
"order": 0,
|
"order": 0,
|
||||||
"providers": [
|
"providers": [
|
||||||
"Modules\\Vacentral\\Providers\\VacentralServiceProvider",
|
"Modules\\Vacentral\\Providers\\AppServiceProvider",
|
||||||
"Modules\\Vacentral\\Providers\\EventServiceProvider"
|
"Modules\\Vacentral\\Providers\\EventServiceProvider"
|
||||||
],
|
],
|
||||||
"aliases": {},
|
"aliases": {},
|
||||||
|
|||||||
Reference in New Issue
Block a user