PHP code example of laravelmodules / core
1. Go to this page and download the library: Download laravelmodules/core 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/ */
laravelmodules / core example snippets
'providers' => [
Amamarul\Modules\LaravelModulesServiceProvider::class,
],
'aliases' => [
'Module' => Amamarul\Modules\Facades\Module::class,
],
php artisan module:use blog
module_config(<MODULE>.config.name);
module_config(example.config.name);
example_config(config.name);
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::assetPath('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('nwidart/hello');
Module::update('hello');
Module::macro('hello', function() {
echo "I'm a macro";
});
Module::hello();
Module::getRequirements('module name');
$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
]
//...
]
php artisan vendor:publish --provider="Amamarul\Modules\LaravelModulesServiceProvider"
php artisan module:core:install"
php artisan module:make <module-name>
php artisan module:make Blog
php artisan module:make Blog User Auth
bash
php artisan module:new:install <ModuleName> <gitUser>/<repositoryName>
bash
php artisan module:new:install Users laravelmodules/users
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
php artisan module:make-mail WelcomeEmail
php artisan module:make-notification InvoicePaid
php artisan module:gitkeep ModuleName
config/
├── module/
├── example/
├── config.php
├── example.php
├── othermodule/
├── config.php
├── othermodule.php
bash
php artisan module:share <module-name>
bash
php artisan module:push <module-name>