PHP code example of code-distortion / laravel-auto-reg

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

    

code-distortion / laravel-auto-reg example snippets

 bash
php artisan vendor:publish --provider="CodeDistortion\LaravelAutoReg\LaravelAutoRegServiceProvider" --tag="config"
 php
// bootstrap/app.php

// Original
$app = new Illuminate\Foundation\Application(
    $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);

// Replace with
$app = (new Illuminate\Foundation\Application(
    $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
))->useAppPath(realpath(__DIR__.'/../src/App'));

src/App/Home/
├─┬ Commands
│ └── NotifyPostSubscribers.php
├─┬ Configs
│ └── blog.php
├─┬ Controllers
│ └── BlogController.php
├─┬ Migrations
│ └── 2020_12_12_000000_create_blog_posts_table.php
├─┬ Requests
│ └── SubmitPostRequest.php
├─┬ Routes
│ ├── api.php
│ ├── channels.php
│ ├── console.php
│ └── web.php
├─┬ ServiceProviders
│ └── EventServiceProvider.php
└─┬ Resources
  ├─┬ Lang
  │ └─┬ en
  │   ├── general.php
  │   └── home.php
  ├─┬ Views
  │ ├─┬ components
  │ │ ├── comment.php
  │ │ └── post.php
  │ └── view-posts.php
  └─┬ ViewComponents
    └── Post.php