readd the vacentral module
This commit is contained in:
5
modules/vacentral/Config/config.php
Normal file
5
modules/vacentral/Config/config.php
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'name' => 'Vacentral'
|
||||||
|
];
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?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");
|
||||||
|
}
|
||||||
|
}
|
||||||
63
modules/vacentral/Http/Controllers/AdminController.php
Normal file
63
modules/vacentral/Http/Controllers/AdminController.php
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<?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()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
64
modules/vacentral/Http/Controllers/VacentralController.php
Normal file
64
modules/vacentral/Http/Controllers/VacentralController.php
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
<?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()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
18
modules/vacentral/Http/routes.php
Normal file
18
modules/vacentral/Http/routes.php
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?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/TestEventListener.php
Normal file
16
modules/vacentral/Listeners/TestEventListener.php
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?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]);
|
||||||
|
}
|
||||||
|
}
|
||||||
25
modules/vacentral/Providers/EventServiceProvider.php
Normal file
25
modules/vacentral/Providers/EventServiceProvider.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Vacentral\Providers;
|
||||||
|
|
||||||
|
use App\Events\TestEvent;
|
||||||
|
use Modules\Vacentral\Listeners\TestEventListener;
|
||||||
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||||
|
|
||||||
|
class EventServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The event listener mappings for the application.
|
||||||
|
*/
|
||||||
|
protected $listen = [
|
||||||
|
TestEvent::class => [TestEventListener::class],
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register any events for your application.
|
||||||
|
*/
|
||||||
|
public function boot()
|
||||||
|
{
|
||||||
|
parent::boot();
|
||||||
|
}
|
||||||
|
}
|
||||||
132
modules/vacentral/Providers/VacentralServiceProvider.php
Normal file
132
modules/vacentral/Providers/VacentralServiceProvider.php
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
<?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 [];
|
||||||
|
}
|
||||||
|
}
|
||||||
18
modules/vacentral/Resources/views/admin/index.blade.php
Normal file
18
modules/vacentral/Resources/views/admin/index.blade.php
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
@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
|
||||||
9
modules/vacentral/Resources/views/index.blade.php
Normal file
9
modules/vacentral/Resources/views/index.blade.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
@extends('vacentral::layouts.frontend')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<h1>Hello World</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
This view is loaded from module: {!! config('vacentral.name') !!}
|
||||||
|
</p>
|
||||||
|
@endsection
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{{--
|
||||||
|
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')
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{{--
|
||||||
|
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')
|
||||||
26
modules/vacentral/composer.json
Normal file
26
modules/vacentral/composer.json
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"name": "/vacentral",
|
||||||
|
"description": "",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"email": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extra": {
|
||||||
|
"laravel": {
|
||||||
|
"providers": [
|
||||||
|
"Modules\\Vacentral\\Providers\\VacentralServiceProvider",
|
||||||
|
"Modules\\Vacentral\\Providers\\EventServiceProvider"
|
||||||
|
],
|
||||||
|
"aliases": {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Modules\\Vacentral\\": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
15
modules/vacentral/module.json
Normal file
15
modules/vacentral/module.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "Vacentral",
|
||||||
|
"alias": "vacentral",
|
||||||
|
"description": "",
|
||||||
|
"keywords": [],
|
||||||
|
"active": 1,
|
||||||
|
"order": 0,
|
||||||
|
"providers": [
|
||||||
|
"Modules\\Vacentral\\Providers\\VacentralServiceProvider",
|
||||||
|
"Modules\\Vacentral\\Providers\\EventServiceProvider"
|
||||||
|
],
|
||||||
|
"aliases": {},
|
||||||
|
"files": [],
|
||||||
|
"requires": []
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user