This view is loaded from module: {!! config('installer.name') !!}
+diff --git a/modules/.gitignore b/modules/.gitignore index d5cb4a01..ab3dacdd 100644 --- a/modules/.gitignore +++ b/modules/.gitignore @@ -3,5 +3,6 @@ /* /*/ !.gitignore +!/Installer !/Sample !/Vacentral diff --git a/modules/Installer/Config/config.php b/modules/Installer/Config/config.php new file mode 100644 index 00000000..0a0b66dc --- /dev/null +++ b/modules/Installer/Config/config.php @@ -0,0 +1,5 @@ + 'Installer' +]; diff --git a/modules/Installer/Http/Controllers/AdminController.php b/modules/Installer/Http/Controllers/AdminController.php new file mode 100644 index 00000000..4c7bdf91 --- /dev/null +++ b/modules/Installer/Http/Controllers/AdminController.php @@ -0,0 +1,63 @@ + []], function() { + + Route::get('/', 'InstallerController@index'); + +}); diff --git a/modules/Installer/Providers/EventServiceProvider.php b/modules/Installer/Providers/EventServiceProvider.php new file mode 100644 index 00000000..889b8ddd --- /dev/null +++ b/modules/Installer/Providers/EventServiceProvider.php @@ -0,0 +1,23 @@ +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() + { + + } + + /** + * Register the routes + */ + protected function registerRoutes() + { + Route::group([ + 'as' => 'installer.', + 'prefix' => 'installer', + // If you want a RESTful module, change this to 'api' + 'middleware' => ['web'], + 'namespace' => 'Modules\Installer\Http\Controllers' + ], function() { + $this->loadRoutesFrom(__DIR__ . '/../Http/routes.php'); + }); + } + + /** + * Register config. + */ + protected function registerConfig() + { + $this->publishes([ + __DIR__.'/../Config/config.php' => config_path('installer.php'), + ], 'config'); + + $this->mergeConfigFrom( + __DIR__.'/../Config/config.php', 'installer' + ); + } + + /** + * Register views. + */ + public function registerViews() + { + $viewPath = resource_path('views/modules/installer'); + $sourcePath = __DIR__.'/../Resources/views'; + + $this->publishes([ + $sourcePath => $viewPath + ],'views'); + + $this->loadViewsFrom(array_merge(array_map(function ($path) { + return $path . '/modules/installer'; + }, \Config::get('view.paths')), [$sourcePath]), 'installer'); + } + + /** + * Register translations. + */ + public function registerTranslations() + { + $langPath = resource_path('lang/modules/installer'); + + if (is_dir($langPath)) { + $this->loadTranslationsFrom($langPath, 'installer'); + } else { + $this->loadTranslationsFrom(__DIR__ .'/../Resources/lang', 'installer'); + } + } + + /** + * 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 []; + } +} diff --git a/modules/Installer/Resources/views/admin/index.blade.php b/modules/Installer/Resources/views/admin/index.blade.php new file mode 100644 index 00000000..9e05a894 --- /dev/null +++ b/modules/Installer/Resources/views/admin/index.blade.php @@ -0,0 +1,18 @@ +@extends('installer::layouts.admin') + +@section('title', 'Installer') +@section('actions') +
This view is loaded from module: {!! config('installer.name') !!}
++ This view is loaded from module: {!! config('installer.name') !!} +
+@endsection diff --git a/modules/Installer/Resources/views/layouts/admin.blade.php b/modules/Installer/Resources/views/layouts/admin.blade.php new file mode 100644 index 00000000..421bbe11 --- /dev/null +++ b/modules/Installer/Resources/views/layouts/admin.blade.php @@ -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') diff --git a/modules/Installer/Resources/views/layouts/frontend.blade.php b/modules/Installer/Resources/views/layouts/frontend.blade.php new file mode 100644 index 00000000..9340e4f9 --- /dev/null +++ b/modules/Installer/Resources/views/layouts/frontend.blade.php @@ -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') diff --git a/modules/Installer/composer.json b/modules/Installer/composer.json new file mode 100644 index 00000000..f66a32a5 --- /dev/null +++ b/modules/Installer/composer.json @@ -0,0 +1,26 @@ +{ + "name": "/installer", + "description": "", + "authors": [ + { + "name": "", + "email": "" + } + ], + "extra": { + "laravel": { + "providers": [ + "Modules\\Installer\\Providers\\InstallerServiceProvider", + "Modules\\Installer\\Providers\\EventServiceProvider" + ], + "aliases": { + + } + } + }, + "autoload": { + "psr-4": { + "Modules\\Installer\\": "" + } + } +} diff --git a/modules/Installer/module.json b/modules/Installer/module.json new file mode 100644 index 00000000..3391d457 --- /dev/null +++ b/modules/Installer/module.json @@ -0,0 +1,15 @@ +{ + "name": "Installer", + "alias": "installer", + "description": "", + "keywords": [], + "active": 1, + "order": 0, + "providers": [ + "Modules\\Installer\\Providers\\InstallerServiceProvider", + "Modules\\Installer\\Providers\\EventServiceProvider" + ], + "aliases": {}, + "files": [], + "requires": [] +}