PHP code example of pingpong / modules
1. Go to this page and download the library: Download pingpong/modules library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pingpong / modules example snippets
'providers' => array(
'Pingpong\Modules\ModulesServiceProvider',
),
php artisan module:use blog
Module::all();
Module::getCached()
Module::getOrdered();
Module::scan();
Module::find('name');
// OR
Module::get('name');
Module::findOrFail('module-name');
Module::getScanPaths();
Module::toCollection();
Module::getByStatus(1);
Module::has('blog');
Module::enabled();
Module::disabled();
Module::count();
Module::getPath();
Module::register();
Module::boot();
Module::collections();
Module::getModulePath('name');
Module::getAssetPath('name');
Module::config('composer.vendor');
Module::getUsedStoragePath();
Module::getUsedNow();
// OR
Module::getUsed();
Module::setUsed('name');
Module::getAssetsPath();
Module::asset('blog:img/logo.img');
Module::install('pingpong-modules/hello');
Module::update('hello');
$module = Module::find('blog');
Lang::get('blog::group.name');
View::make('blog::index')
View::make('blog::partials.sidebar')
Config::get('blog.name')
// file config/modules.php
return [
//...
'scan' => [
'enabled' => true
]
//...
]
'aliases' => array(
'Module' => 'Pingpong\Modules\Facades\Module',
),
php artisan vendor:publish
php artisan module:make <module-name>
php artisan module:make Blog
php artisan module:make Blog User Auth
laravel-app/
app/
bootstrap/
vendor/
modules/
├── Blog/
├── Assets/
├── Config/
├── Console/
├── Database/
├── Migrations/
├── Seeders/
├── Entities/
├── Http/
├── Controllers/
├── Middleware/
├── Requests/
├── routes.php
├── Providers/
├── BlogServiceProvider.php
├── Resources/
├── lang/
├── views/
├── Repositories/
├── Tests/
├── composer.json
├── module.json
├── start.php
php artisan module:make blog
php artisan module:migrate-rollback
php artisan module:migrate-reset
php artisan module:migrate-refresh
php artisan module:migrate-rollback blog
php artisan module:migrate-reset blog
php artisan module:migrate-refresh blog
php artisan module:make-seed users blog
php artisan module:migrate blog
php artisan module:migrate
php artisan module:seed blog
php artisan module:seed
php artisan module:make-controller SiteController blog
php artisan module:publish blog
php artisan module:publish
php artisan module:make-provider MyServiceProvider blog
php artisan module:publish-migration blog
php artisan module:publish-migration
php artisan module:enable blog
php artisan module:disable blog
php artisan module:make-middleware Auth