PHP code example of selimppc / laravel-modules

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

    

selimppc / laravel-modules example snippets


$ php artisan serve

$ php artisan laravel-modules:make Blog

'enabled' => [
    'Example' => [...],
    'Blog' => [
        'web' => ['prefix' => 'blog',      'middleware' => ['web'], 'as' => 'blog.'],
        'api' => ['prefix' => 'api/blog',  'middleware' => ['api'], 'as' => 'blog.api.'],
    ],
],

Modules/
  Blog/
    routes/web.php
    routes/api.php
    Http/Controllers/...
    Repositories/Contracts/...
    Repositories/Eloquent...
    resources/views/...
    resources/lang/...
    bindings.php      # optional DI bindings for this module

$ php artisan route:cache
$ php artisan config:cache
$ php artisan view:cache

$ php artisan route:clear
$ php artisan config:clear

$ php artisan route:list | grep example
$ php artisan tinker

>>> class_exists(\Modules\Example\Http\Controllers\ExampleController::class)
Editor warns “Undefined function base_path()”