PHP code example of hatchyu / laravel-modular

1. Go to this page and download the library: Download hatchyu/laravel-modular 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/ */

    

hatchyu / laravel-modular example snippets


return [
    'path' => base_path('modules'),
    'namespace' => 'Modules\\',
    'layout' => 'ddd',
    'autodiscover' => [
        'providers' => true,
        'routes' => true,
        'migrations' => true,
        'views' => true,
        'configs' => true,
        'factories' => true,
    ],
    'routing' => [
        'web_middleware' => ['web'],
        'api_middleware' => ['api'],
        'api_prefix' => 'api',
    ],
    'cache_path' => base_path('bootstrap/cache/modules.php'),
    'stubs_path' => null,
];
bash
composer dump-autoload
bash
php artisan vendor:publish --tag=modular-config
bash
php artisan module:rename Order Sales
bash
php artisan module:make Order
bash
# Database Migration
php artisan module:make-migration Order create_orders_table

# Database Seeder
php artisan module:make-seeder Order OrderSeeder
bash
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan module:cache