PHP code example of dnt / laravel-module

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

    

dnt / laravel-module example snippets


app(\DNT\Module\Contracts\Management::class)->get('cart-manager');

app(\DNT\Module\Contracts\Management::class)->all();

app(\DNT\Module\Contracts\Management::class)->enable('cart-manager');

app(\DNT\Module\Contracts\Management::class)->disable('cart-manager');

// Controller
...
return view('cart-manager::index');
...

__('cart-manager::name'); 

|-app
|-bootstrap
|-config
...
|-modules
|----CartManager
|-------Facades
|-----------Cart.php
|-------Providers
|-----------CartManagerServiceProvider.php
|-------views
|------------index.blade.php
|-------lang
|------------en
|----------------validation.php
|------------en.json
|-------helpers.php
|-------module.json
...
|-composer.json
|.env
...
json
{
  "name": "Cart Manager",
  "key": "cart-manager",
  "providers": [
    "CartManager\\Providers\\CartManagerServiceProvider"
  ],
  "aliases": {
    "Cart": "CartManager\\Facades\\Cart"
  },
  "files": [
    "./helpers.php"
  ],
  "views": [
    "./views"
  ],
  "langs": [
    "./lang"
  ],
  "enable": true
}