PHP code example of alxdorosenco / porto-for-laravel

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

    

alxdorosenco / porto-for-laravel example snippets


    $app->singleton(
        Illuminate\Contracts\Http\Kernel::class,
        App\Http\Kernel::class
    );
    
    $app->singleton(
        Illuminate\Contracts\Console\Kernel::class,
        App\Console\Kernel::class
    );
    
    $app->singleton(
        Illuminate\Contracts\Debug\ExceptionHandler::class,
        App\Exceptions\Handler::class
    );
   

    $app->singleton(
        Illuminate\Contracts\Http\Kernel::class,
        <Porto path name>\Ship\Kernels\HttpKernel::class
    );
    
    $app->singleton(
        Illuminate\Contracts\Console\Kernel::class,
        <Porto path name>\Ship\Kernels\ConsoleKernel::class
    );
    
    $app->singleton(
        Illuminate\Contracts\Debug\ExceptionHandler::class,
        <Porto path name>\Ship\Exceptions\Handler::class
    );
   

   /*
   * Application Service Providers...
   */
   //App\Providers\AppServiceProvider::class,
   //App\Providers\AuthServiceProvider::class,
   // App\Providers\BroadcastServiceProvider::class,
   //App\Providers\EventServiceProvider::class,
   //App\Providers\RouteServiceProvider::class
   

   php artisan porto:install --container=<Container Name> --container-<Container Type>
   

php artisan make:container <Name>

Container
	├── Actions
	├── Tasks
	├── Models
	├── Loaders
	│   ├── AliasesLoader.php
	│   ├── ProvidersLoader.php
	│   └── MiddlewareLoader.php  
	└── UI
	    ├── WEB
	    │   ├── Routes
	    │   ├── Controllers
	    │   └── Views
	    ├── API
	    │   ├── Routes
	    │   ├── Controllers
	    │   └── Transformers
	    └── CLI
	        ├── Routes
	        └── Commands

php artisan make:container <Name> --api

Container
	├── Actions
	├── Tasks
	├── Models
	├── Loaders
	│   ├── AliasesLoader.php
	│   ├── ProvidersLoader.php
	│   └── MiddlewareLoader.php  
	└── UI
	    └── API
	        ├── Routes
	        ├── Controllers
	        └── Transformers

php artisan make:container <Name> --cli

Container
	├── Actions
	├── Tasks
	├── Models
	├── Loaders
	│   ├── AliasesLoader.php
	│   ├── ProvidersLoader.php
	│   └── MiddlewareLoader.php  
	└── UI
	    └── CLI
	        ├── Routes
	        └── Commands

php artisan make:container <Name> --web

Container
	├── Actions
	├── Tasks
	├── Models
	├── Loaders
	│   ├── AliasesLoader.php
	│   ├── ProvidersLoader.php
	│   └── MiddlewareLoader.php  
	└── UI
	    └── WEB
	        ├── Routes
	        ├── Controllers
	        └── Views

php artisan make:cast <Name> --container=<Container Name>

php artisan make:channel <Name> --container=<Container Name>

php artisan make:command <Name>
php artisan make:command <Name> --container=<Container Name>

php artisan make:component <Name> --container=<Container Name>

php artisan make:controller <Name> --container=<Container Name>

php artisan make:enum <Name> --container=<Container Name>

php artisan make:event <Name>
php artisan make:event <Name> --container=<Container Name>

php artisan make:exception <Name>
php artisan make:exception <Name> --container=<Container Name>

php artisan make:factory <Name> --container=<Container Name>

php artisan make:job <Name>
php artisan make:job <Name> --container=<Container Name>

php artisan make:listener <Name> --container=<Container Name>

php artisan make:mail <Name>
php artisan make:mail <Name> --container=<Container Name>

php artisan make:middleware <Name>
php artisan make:middleware <Name> --container=<Container Name>

php artisan make:model <Name> --container=<Container Name>

php artisan make:notification <Name>
php artisan make:notification <Name> --container=<Container Name>

php artisan make:observer <Name> --container=<Container Name>

php artisan make:policy <Name> --container=<Container Name>

php artisan make:provider <Name>
php artisan make:provider <Name> --container=<Container Name>

php artisan make:request <Name> --container=<Container Name> --uiType=api
php artisan make:request <Name> --container=<Container Name> --uiType=web

php artisan make:resource <Name> --container=<Container Name>

php artisan make:rule <Name> --container=<Container Name>

php artisan make:scope <Name> --container=<Container Name>

php artisan make:seeder <Name>
php artisan make:seeder <Name> --container=<Container Name>

php artisan make:test <Name> --container=<Container Name> --uiType=api
php artisan make:test <Name> --container=<Container Name> --uiType=cli
php artisan make:test <Name> --container=<Container Name> --uiType=web

php artisan make:action <Name> --container=<Container Name>

php artisan make:config <Name>
php artisan make:config <Name> --container=<Container Name>

php artisan make:contract <Name> --container=<Container Name>

php artisan make:helper <Name>

php artisan make:repository <Name>

php artisan make:task <Name> --container=<Container Name>

php artisan make:trait <Name> --container=<Container Name>
php artisan make:trait <Name> --container=<Container Name> --test

php artisan make:translation <Name> --lang=<lang code>