diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index fe20b05b..de867ce5 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -27,6 +27,7 @@ class AppServiceProvider extends ServiceProvider $this->app->register('Iber\Generator\ModelGeneratorProvider'); } + // register PingPong module extension $this->app->register('Pingpong\Modules\ModulesServiceProvider'); } } diff --git a/bootstrap/cache/.gitignore b/bootstrap/cache/.gitignore old mode 100644 new mode 100755 diff --git a/composer.json b/composer.json index f74cc55c..b1050319 100644 --- a/composer.json +++ b/composer.json @@ -1,55 +1,60 @@ { - "name": "laravel/laravel", - "description": "The Laravel Framework.", - "keywords": ["framework", "laravel"], - "license": "MIT", - "type": "project", - "require": { - "php": ">=5.5.9", - "laravel/framework": "5.2.*", - "phpmailer/phpmailer": "^5.2", - "pingpong/modules": "~2.0" - }, - "require-dev": { - "fzaninotto/faker": "~1.4", - "mockery/mockery": "0.9.*", - "phpunit/phpunit": "~4.0", - "symfony/css-selector": "2.8.*|3.0.*", - "symfony/dom-crawler": "2.8.*|3.0.*", - "ignasbernotas/laravel-model-generator": "^1.0" - }, - "autoload": { - "classmap": [ - "database" - ], - "psr-4": { - "App\\": "app/" - } - }, - "autoload-dev": { - "classmap": [ - "tests/TestCase.php" - ] - }, - "scripts": { - "post-root-package-install": [ - "php -r \"copy('.env.example', '.env');\"" - ], - "post-create-project-cmd": [ - "php artisan key:generate" - ], - "post-install-cmd": [ - "php artisan clear-compiled", - "php artisan optimize" - ], - "pre-update-cmd": [ - "php artisan clear-compiled" - ], - "post-update-cmd": [ - "php artisan optimize" - ] - }, - "config": { - "preferred-install": "dist" + "name": "laravel/laravel", + "description": "The Laravel Framework.", + "keywords": [ + "framework", + "laravel" + ], + "license": "MIT", + "type": "project", + "require": { + "php": ">=5.5.9", + "laravel/framework": "5.2.*", + "phpmailer/phpmailer": "^5.2", + "pingpong/modules": "~2.0", + "league/flysystem": "^1.0" + }, + "require-dev": { + "fzaninotto/faker": "~1.4", + "mockery/mockery": "0.9.*", + "phpunit/phpunit": "~4.0", + "symfony/css-selector": "2.8.*|3.0.*", + "symfony/dom-crawler": "2.8.*|3.0.*", + "ignasbernotas/laravel-model-generator": "^1.0" + }, + "autoload": { + "classmap": [ + "database" + ], + "psr-4": { + "App\\": "app/", + "Modules\\": "modules/" } + }, + "autoload-dev": { + "classmap": [ + "tests/TestCase.php" + ] + }, + "scripts": { + "post-root-package-install": [ + "php -r \"copy('.env.example', '.env');\"" + ], + "post-create-project-cmd": [ + "php artisan key:generate" + ], + "post-install-cmd": [ + "php artisan clear-compiled", + "php artisan optimize" + ], + "pre-update-cmd": [ + "php artisan clear-compiled" + ], + "post-update-cmd": [ + "php artisan optimize" + ] + }, + "config": { + "preferred-install": "dist" + } } diff --git a/config/app.php b/config/app.php index 77c3124b..3226b67b 100644 --- a/config/app.php +++ b/config/app.php @@ -147,6 +147,7 @@ return [ Illuminate\Translation\TranslationServiceProvider::class, Illuminate\Validation\ValidationServiceProvider::class, Illuminate\View\ViewServiceProvider::class, + Pingpong\Modules\ModulesServiceProvider::class, /* * Application Service Providers... diff --git a/modules/TestingModule/Assets/.gitkeep b/modules/TestingModule/Assets/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/modules/TestingModule/Config/.gitkeep b/modules/TestingModule/Config/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/modules/TestingModule/Config/config.php b/modules/TestingModule/Config/config.php new file mode 100644 index 00000000..a8ff8368 --- /dev/null +++ b/modules/TestingModule/Config/config.php @@ -0,0 +1,5 @@ + 'TestingModule' +]; \ No newline at end of file diff --git a/modules/TestingModule/Console/.gitkeep b/modules/TestingModule/Console/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/modules/TestingModule/Database/Migrations/.gitkeep b/modules/TestingModule/Database/Migrations/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/modules/TestingModule/Database/Seeders/.gitkeep b/modules/TestingModule/Database/Seeders/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/modules/TestingModule/Database/Seeders/TestingModuleDatabaseSeeder.php b/modules/TestingModule/Database/Seeders/TestingModuleDatabaseSeeder.php new file mode 100644 index 00000000..ab91f102 --- /dev/null +++ b/modules/TestingModule/Database/Seeders/TestingModuleDatabaseSeeder.php @@ -0,0 +1,20 @@ +call("OthersTableSeeder"); + } + +} \ No newline at end of file diff --git a/modules/TestingModule/Entities/.gitkeep b/modules/TestingModule/Entities/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/modules/TestingModule/Http/Controllers/.gitkeep b/modules/TestingModule/Http/Controllers/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/modules/TestingModule/Http/Controllers/TestingModuleController.php b/modules/TestingModule/Http/Controllers/TestingModuleController.php new file mode 100644 index 00000000..1e85a442 --- /dev/null +++ b/modules/TestingModule/Http/Controllers/TestingModuleController.php @@ -0,0 +1,12 @@ + 'web', 'prefix' => 'testingmodule', 'namespace' => 'Modules\TestingModule\Http\Controllers'], function() +{ + Route::get('/', 'TestingModuleController@index'); +}); \ No newline at end of file diff --git a/modules/TestingModule/Providers/.gitkeep b/modules/TestingModule/Providers/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/modules/TestingModule/Providers/TestingModuleServiceProvider.php b/modules/TestingModule/Providers/TestingModuleServiceProvider.php new file mode 100644 index 00000000..babe3f66 --- /dev/null +++ b/modules/TestingModule/Providers/TestingModuleServiceProvider.php @@ -0,0 +1,97 @@ +registerTranslations(); + $this->registerConfig(); + $this->registerViews(); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + // + } + + /** + * Register config. + * + * @return void + */ + protected function registerConfig() + { + $this->publishes([ + __DIR__.'/../Config/config.php' => config_path('testingmodule.php'), + ]); + $this->mergeConfigFrom( + __DIR__.'/../Config/config.php', 'testingmodule' + ); + } + + /** + * Register views. + * + * @return void + */ + public function registerViews() + { + $viewPath = base_path('resources/views/modules/testingmodule'); + + $sourcePath = __DIR__.'/../Resources/views'; + + $this->publishes([ + $sourcePath => $viewPath + ]); + + $this->loadViewsFrom(array_merge(array_map(function ($path) { + return $path . '/modules/testingmodule'; + }, \Config::get('view.paths')), [$sourcePath]), 'testingmodule'); + } + + /** + * Register translations. + * + * @return void + */ + public function registerTranslations() + { + $langPath = base_path('resources/lang/modules/testingmodule'); + + if (is_dir($langPath)) { + $this->loadTranslationsFrom($langPath, 'testingmodule'); + } else { + $this->loadTranslationsFrom(__DIR__ .'/../Resources/lang', 'testingmodule'); + } + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return array(); + } + +} diff --git a/modules/TestingModule/Repositories/.gitkeep b/modules/TestingModule/Repositories/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/modules/TestingModule/Resources/lang/.gitkeep b/modules/TestingModule/Resources/lang/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/modules/TestingModule/Resources/views/.gitkeep b/modules/TestingModule/Resources/views/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/modules/TestingModule/Resources/views/index.blade.php b/modules/TestingModule/Resources/views/index.blade.php new file mode 100644 index 00000000..2c8c3ea8 --- /dev/null +++ b/modules/TestingModule/Resources/views/index.blade.php @@ -0,0 +1,11 @@ +@extends('testingmodule::layouts.master') + +@section('content') + +
+ This view is loaded from module: {!! config('testingmodule.name') !!} +
+ +@stop \ No newline at end of file diff --git a/modules/TestingModule/Resources/views/layouts/master.blade.php b/modules/TestingModule/Resources/views/layouts/master.blade.php new file mode 100644 index 00000000..324dd083 --- /dev/null +++ b/modules/TestingModule/Resources/views/layouts/master.blade.php @@ -0,0 +1,12 @@ + + + + + + +