Merge branch 'testing-modules' into dev
This commit is contained in:
@@ -27,6 +27,7 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
$this->app->register('Iber\Generator\ModelGeneratorProvider');
|
$this->app->register('Iber\Generator\ModelGeneratorProvider');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// register PingPong module extension
|
||||||
$this->app->register('Pingpong\Modules\ModulesServiceProvider');
|
$this->app->register('Pingpong\Modules\ModulesServiceProvider');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Regular → Executable
+57
-52
@@ -1,55 +1,60 @@
|
|||||||
{
|
{
|
||||||
"name": "laravel/laravel",
|
"name": "laravel/laravel",
|
||||||
"description": "The Laravel Framework.",
|
"description": "The Laravel Framework.",
|
||||||
"keywords": ["framework", "laravel"],
|
"keywords": [
|
||||||
"license": "MIT",
|
"framework",
|
||||||
"type": "project",
|
"laravel"
|
||||||
"require": {
|
],
|
||||||
"php": ">=5.5.9",
|
"license": "MIT",
|
||||||
"laravel/framework": "5.2.*",
|
"type": "project",
|
||||||
"phpmailer/phpmailer": "^5.2",
|
"require": {
|
||||||
"pingpong/modules": "~2.0"
|
"php": ">=5.5.9",
|
||||||
},
|
"laravel/framework": "5.2.*",
|
||||||
"require-dev": {
|
"phpmailer/phpmailer": "^5.2",
|
||||||
"fzaninotto/faker": "~1.4",
|
"pingpong/modules": "~2.0",
|
||||||
"mockery/mockery": "0.9.*",
|
"league/flysystem": "^1.0"
|
||||||
"phpunit/phpunit": "~4.0",
|
},
|
||||||
"symfony/css-selector": "2.8.*|3.0.*",
|
"require-dev": {
|
||||||
"symfony/dom-crawler": "2.8.*|3.0.*",
|
"fzaninotto/faker": "~1.4",
|
||||||
"ignasbernotas/laravel-model-generator": "^1.0"
|
"mockery/mockery": "0.9.*",
|
||||||
},
|
"phpunit/phpunit": "~4.0",
|
||||||
"autoload": {
|
"symfony/css-selector": "2.8.*|3.0.*",
|
||||||
"classmap": [
|
"symfony/dom-crawler": "2.8.*|3.0.*",
|
||||||
"database"
|
"ignasbernotas/laravel-model-generator": "^1.0"
|
||||||
],
|
},
|
||||||
"psr-4": {
|
"autoload": {
|
||||||
"App\\": "app/"
|
"classmap": [
|
||||||
}
|
"database"
|
||||||
},
|
],
|
||||||
"autoload-dev": {
|
"psr-4": {
|
||||||
"classmap": [
|
"App\\": "app/",
|
||||||
"tests/TestCase.php"
|
"Modules\\": "modules/"
|
||||||
]
|
|
||||||
},
|
|
||||||
"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"
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ return [
|
|||||||
Illuminate\Translation\TranslationServiceProvider::class,
|
Illuminate\Translation\TranslationServiceProvider::class,
|
||||||
Illuminate\Validation\ValidationServiceProvider::class,
|
Illuminate\Validation\ValidationServiceProvider::class,
|
||||||
Illuminate\View\ViewServiceProvider::class,
|
Illuminate\View\ViewServiceProvider::class,
|
||||||
|
Pingpong\Modules\ModulesServiceProvider::class,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Application Service Providers...
|
* Application Service Providers...
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'name' => 'TestingModule'
|
||||||
|
];
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?php namespace Modules\Testingmodule\Database\Seeders;
|
||||||
|
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class TestingModuleDatabaseSeeder extends Seeder {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function run()
|
||||||
|
{
|
||||||
|
Model::unguard();
|
||||||
|
|
||||||
|
// $this->call("OthersTableSeeder");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php namespace Modules\Testingmodule\Http\Controllers;
|
||||||
|
|
||||||
|
use Pingpong\Modules\Routing\Controller;
|
||||||
|
|
||||||
|
class TestingModuleController extends Controller {
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
return view('testingmodule::index');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
Route::group(['middleware' => 'web', 'prefix' => 'testingmodule', 'namespace' => 'Modules\TestingModule\Http\Controllers'], function()
|
||||||
|
{
|
||||||
|
Route::get('/', 'TestingModuleController@index');
|
||||||
|
});
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
<?php namespace Modules\Testingmodule\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
|
class TestingModuleServiceProvider extends ServiceProvider {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if loading of the provider is deferred.
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected $defer = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Boot the application events.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function boot()
|
||||||
|
{
|
||||||
|
$this->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();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
@extends('testingmodule::layouts.master')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
<h1>Hello World</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
This view is loaded from module: {!! config('testingmodule.name') !!}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
@stop
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>Module TestingModule</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
@yield('content')
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "pingpong-modules/testingmodule",
|
||||||
|
"description": "",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Pingpong Labs",
|
||||||
|
"email": "pingpong.labs@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Modules\\TestingModule\\": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "TestingModule",
|
||||||
|
"alias": "testingmodule",
|
||||||
|
"description": "",
|
||||||
|
"keywords": [],
|
||||||
|
"active": 1,
|
||||||
|
"order": 0,
|
||||||
|
"providers": [
|
||||||
|
"Modules\\TestingModule\\Providers\\TestingModuleServiceProvider"
|
||||||
|
],
|
||||||
|
"aliases":{},
|
||||||
|
"files": [
|
||||||
|
"start.php"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Register Namespaces And Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When a module starting, this file will executed automatically. This helps
|
||||||
|
| to register some namespaces like translator or view. Also this file
|
||||||
|
| will load the routes file for each module. You may also modify
|
||||||
|
| this file as you want.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
require __DIR__ . '/Http/routes.php';
|
||||||
Reference in New Issue
Block a user