PHP code example of codeurx / modular

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

    

codeurx / modular example snippets


php artisan vendor:publish --provider="Codeurx\Modular\ModularServiceProvider" --tag="migrations"

php artisan migrate
 bash
php artisan modular:make <module-name>

app/Modules/
      ├── Users/
          ├─ Database/
             ├─ Migrations/
          ├─ Http/
             ├─ Controllers/
                ├─ UsersController.php
             ├─ Models/
                ├─ UsersModel.php
          ├─ Providers/
             ├─ UsersServiceProvider.php
          ├─ Resources/
             ├─ views/
                ├─ index.blade.php
          ├─ Routes/
             ├─ web.php 
      
 bash
php artisan modular:delete <module-name>
 bash
php artisan modular:list
 bash
 php artisan modular:migrate
 
 bash
 php artisan modular:migrate <module-name>
 
 bash
  php artisan modular:make-controller users TestController
  
 bash
  php artisan modular:make-controller users Test/TestController
  

app/Modules/
      ├── Users/
          ├─ Database/
             ├─ Migrations/
          ├─ Http/
             ├─ Controllers/
                ├─ Test 
                   ├─ TestController.php
                ├─ UsersController.php
             ├─ Models/
                ├─ UsersModel.php
          ├─ Providers/
             ├─ UsersServiceProvider.php
          ├─ Resources/
             ├─ views/
                ├─ index.blade.php
          ├─ Routes/
             ├─ web.php 
      



/*
|--------------------------------------------------------------------------
| Users Module Routes
|--------------------------------------------------------------------------
|
| All the routes related to the Users module have to go in here. 
|
*/

Route::get('/', 'UsersController@index');
Route::get('/users-test', 'UsersController@UsersTest');
Route::get('/test', 'Test\TestController@index');
 bash
  php artisan modular:make-model users TestModel
  
 bash
  php artisan modular:make-model users Test/TestModel
  

app/Modules/
      ├── Users/
          ├─ Database/
             ├─ Migrations/
          ├─ Http/
             ├─ Controllers/
                ├─ UsersController.php
             ├─ Models/
                ├─ Test 
                   ├─ TestModel.php
                ├─ UsersModel.php
          ├─ Providers/
             ├─ UsersServiceProvider.php
          ├─ Resources/
             ├─ views/
                ├─ index.blade.php
          ├─ Routes/
             ├─ web.php