diff --git a/.gitignore b/.gitignore index 4ff2efca..6a3f5855 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +/resources/views/vendor +!/resources/views/vendor/.gitkeep /.env /vendor /.idea diff --git a/app/Http/Controllers/Admin/Controller.php b/app/Http/Controllers/Admin/Controller.php new file mode 100644 index 00000000..f71a5b90 --- /dev/null +++ b/app/Http/Controllers/Admin/Controller.php @@ -0,0 +1,24 @@ +menu = Menu::instance('navbar'); + + var_dump($this->menu); + } +} diff --git a/app/Http/Controllers/Admin/Dashboard.php b/app/Http/Controllers/Admin/Dashboard.php index 29438702..aa6bd5a2 100644 --- a/app/Http/Controllers/Admin/Dashboard.php +++ b/app/Http/Controllers/Admin/Dashboard.php @@ -3,13 +3,19 @@ namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; - use App\Http\Requests; -use App\Http\Controllers\Controller; class Dashboard extends Controller { + /** + * Dashboard constructor. + */ + public function __construct() + { + parent::__construct(); + } + public function getIndex() { - echo "dasboard"; + return view('admin.dashboard'); } } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index de867ce5..f85ff5dc 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -29,5 +29,6 @@ class AppServiceProvider extends ServiceProvider // register PingPong module extension $this->app->register('Pingpong\Modules\ModulesServiceProvider'); + $this->app->register('Pingpong\Menus\MenusServiceProvider'); } } diff --git a/composer.json b/composer.json index b1050319..00957e95 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,8 @@ "laravel/framework": "5.2.*", "phpmailer/phpmailer": "^5.2", "pingpong/modules": "~2.0", - "league/flysystem": "^1.0" + "league/flysystem": "^1.0", + "pingpong/menus": "^2.2" }, "require-dev": { "fzaninotto/faker": "~1.4", diff --git a/composer.lock b/composer.lock index 9472dc5a..28ee49cf 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "27cde2cd04e297873d56aa999ffbfb68", - "content-hash": "3fc78d80cf6d04d2e213062f07ce40af", + "hash": "e1df7a663824f03abec6a4688a30e0d3", + "content-hash": "f6d1dca260e16530b88c6572ad98598e", "packages": [ { "name": "classpreloader/classpreloader", @@ -1434,6 +1434,58 @@ ], "time": "2016-01-06 08:28:33" }, + { + "name": "pingpong/menus", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/pingpong-labs/menus.git", + "reference": "ecb400916b6189e66c2ed1f91a8cffa58fd7f83a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pingpong-labs/menus/zipball/ecb400916b6189e66c2ed1f91a8cffa58fd7f83a", + "reference": "ecb400916b6189e66c2ed1f91a8cffa58fd7f83a", + "shasum": "" + }, + "require": { + "illuminate/config": "5.2.*", + "illuminate/support": "5.2.*", + "illuminate/view": "5.2.*", + "laravelcollective/html": "~5.0", + "php": ">=5.5.9" + }, + "require-dev": { + "mockery/mockery": "~0.9", + "phpunit/phpunit": "~4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Pingpong\\Menus\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Pingpong Labs", + "email": "pingpong.labs@gmail.com" + } + ], + "description": "Laravel Menus", + "keywords": [ + "bootstrap", + "laravel", + "menus", + "nav", + "navigation", + "pingpong" + ], + "time": "2016-01-12 03:54:35" + }, { "name": "pingpong/modules", "version": "v2.2.0", diff --git a/config/app.php b/config/app.php index 3226b67b..ce43f3b2 100644 --- a/config/app.php +++ b/config/app.php @@ -13,8 +13,7 @@ return [ | */ - 'env' => env('APP_ENV', 'production'), - + 'env' => env('APP_ENV', 'production'), /* |-------------------------------------------------------------------------- | Application Debug Mode @@ -26,8 +25,7 @@ return [ | */ - 'debug' => env('APP_DEBUG', false), - + 'debug' => env('APP_DEBUG', false), /* |-------------------------------------------------------------------------- | Application URL @@ -39,8 +37,7 @@ return [ | */ - 'url' => 'http://localhost', - + 'url' => 'http://localhost', /* |-------------------------------------------------------------------------- | Application Timezone @@ -52,8 +49,7 @@ return [ | */ - 'timezone' => 'UTC', - + 'timezone' => 'UTC', /* |-------------------------------------------------------------------------- | Application Locale Configuration @@ -65,8 +61,7 @@ return [ | */ - 'locale' => 'en', - + 'locale' => 'en', /* |-------------------------------------------------------------------------- | Application Fallback Locale @@ -79,7 +74,6 @@ return [ */ 'fallback_locale' => 'en', - /* |-------------------------------------------------------------------------- | Encryption Key @@ -91,10 +85,8 @@ return [ | */ - 'key' => env('APP_KEY'), - - 'cipher' => 'AES-256-CBC', - + 'key' => env('APP_KEY'), + 'cipher' => 'AES-256-CBC', /* |-------------------------------------------------------------------------- | Logging Configuration @@ -108,8 +100,7 @@ return [ | */ - 'log' => env('APP_LOG', 'single'), - + 'log' => env('APP_LOG', 'single'), /* |-------------------------------------------------------------------------- | Autoloaded Service Providers @@ -121,7 +112,7 @@ return [ | */ - 'providers' => [ + 'providers' => [ /* * Laravel Framework Service Providers... @@ -148,7 +139,7 @@ return [ Illuminate\Validation\ValidationServiceProvider::class, Illuminate\View\ViewServiceProvider::class, Pingpong\Modules\ModulesServiceProvider::class, - + Pingpong\Menus\MenusServiceProvider::class, /* * Application Service Providers... */ @@ -159,7 +150,6 @@ return [ App\Providers\GlobalViewDataProvider::class, ], - /* |-------------------------------------------------------------------------- | Class Aliases @@ -171,7 +161,7 @@ return [ | */ - 'aliases' => [ + 'aliases' => [ 'App' => Illuminate\Support\Facades\App::class, 'Artisan' => Illuminate\Support\Facades\Artisan::class, @@ -190,6 +180,7 @@ return [ 'Lang' => Illuminate\Support\Facades\Lang::class, 'Log' => Illuminate\Support\Facades\Log::class, 'Mail' => Illuminate\Support\Facades\Mail::class, + 'Menu' => Pingpong\Menus\MenuFacade::class, 'Password' => Illuminate\Support\Facades\Password::class, 'Queue' => Illuminate\Support\Facades\Queue::class, 'Redirect' => Illuminate\Support\Facades\Redirect::class, diff --git a/config/menus.php b/config/menus.php new file mode 100644 index 00000000..70d950b0 --- /dev/null +++ b/config/menus.php @@ -0,0 +1,16 @@ + [ + 'navbar' => 'Pingpong\Menus\Presenters\Bootstrap\NavbarPresenter', + 'navbar-right' => 'Pingpong\Menus\Presenters\Bootstrap\NavbarRightPresenter', + 'nav-pills' => 'Pingpong\Menus\Presenters\Bootstrap\NavPillsPresenter', + 'nav-tab' => 'Pingpong\Menus\Presenters\Bootstrap\NavTabPresenter', + 'sidebar' => 'Pingpong\Menus\Presenters\Bootstrap\SidebarMenuPresenter', + 'navmenu' => 'Pingpong\Menus\Presenters\Bootstrap\NavMenuPresenter', + ], + + 'ordering' => false, + +]; diff --git a/config/modules.php b/config/modules.php new file mode 100644 index 00000000..80edfbbb --- /dev/null +++ b/config/modules.php @@ -0,0 +1,160 @@ + 'Modules', + + /* + |-------------------------------------------------------------------------- + | Module Stubs + |-------------------------------------------------------------------------- + | + | Default module stubs. + | + */ + + 'stubs' => [ + 'enabled' => false, + 'path' => base_path().'/vendor/pingpong/modules/src/Pingpong/Modules/Commands/stubs', + 'files' => [ + 'start' => 'start.php', + 'routes' => 'Http/routes.php', + 'json' => 'module.json', + 'views/index' => 'Resources/views/index.blade.php', + 'views/master' => 'Resources/views/layouts/master.blade.php', + 'scaffold/config' => 'Config/config.php', + 'composer' => 'composer.json', + ], + 'replacements' => [ + 'start' => ['LOWER_NAME'], + 'routes' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE'], + 'json' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE'], + 'views/index' => ['LOWER_NAME'], + 'views/master' => ['STUDLY_NAME'], + 'scaffold/config' => ['STUDLY_NAME'], + 'composer' => [ + 'LOWER_NAME', + 'STUDLY_NAME', + 'VENDOR', + 'AUTHOR_NAME', + 'AUTHOR_EMAIL', + 'MODULE_NAMESPACE', + ], + ], + ], + 'paths' => [ + /* + |-------------------------------------------------------------------------- + | Modules path + |-------------------------------------------------------------------------- + | + | This path used for save the generated module. This path also will added + | automatically to list of scanned folders. + | + */ + + 'modules' => base_path('modules'), + /* + |-------------------------------------------------------------------------- + | Modules assets path + |-------------------------------------------------------------------------- + | + | Here you may update the modules assets path. + | + */ + + 'assets' => public_path('modules'), + /* + |-------------------------------------------------------------------------- + | The migrations path + |-------------------------------------------------------------------------- + | + | Where you run 'module:publish-migration' command, where do you publish the + | the migration files? + | + */ + + 'migration' => base_path('database/migrations'), + /* + |-------------------------------------------------------------------------- + | Generator path + |-------------------------------------------------------------------------- + | + | Here you may update the modules generator path. + | + */ + + 'generator' => [ + 'assets' => 'Assets', + 'config' => 'Config', + 'command' => 'Console', + 'migration' => 'Database/Migrations', + 'model' => 'Entities', + 'repository' => 'Repositories', + 'seeder' => 'Database/Seeders', + 'controller' => 'Http/Controllers', + 'filter' => 'Http/Middleware', + 'request' => 'Http/Requests', + 'provider' => 'Providers', + 'lang' => 'Resources/lang', + 'views' => 'Resources/views', + 'test' => 'Tests', + ], + ], + /* + |-------------------------------------------------------------------------- + | Scan Path + |-------------------------------------------------------------------------- + | + | Here you define which folder will be scanned. By default will scan vendor + | directory. This is useful if you host the package in packagist website. + | + */ + + 'scan' => [ + 'enabled' => false, + 'paths' => [ + base_path('vendor/*/*'), + ], + ], + /* + |-------------------------------------------------------------------------- + | Composer File Template + |-------------------------------------------------------------------------- + | + | Here is the config for composer.json file, generated by this package + | in every module since version >= 1.2.0. + | + */ + + 'composer' => [ + 'vendor' => 'pingpong-modules', + 'author' => [ + 'name' => 'Pingpong Labs', + 'email' => 'pingpong.labs@gmail.com', + ], + ], + /* + |-------------------------------------------------------------------------- + | Caching + |-------------------------------------------------------------------------- + | + | Here is the config for setting up caching feature. + | + */ + 'cache' => [ + 'enabled' => false, + 'key' => 'pingpong-modules', + 'lifetime' => 60, + ], + +]; diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php new file mode 100644 index 00000000..0dbc0a2f --- /dev/null +++ b/resources/views/admin/dashboard.blade.php @@ -0,0 +1,9 @@ +@extends('admin.layout') + +@section('content') + +