PHP code example of nunomaduro / essentials

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

    

nunomaduro / essentials example snippets




declare(strict_types=1);

namespace App\Actions;

final readonly class CreateUserAction
{
    /**
     * Execute the action.
     */
    public function handle(): void
    {
        DB::transaction(function (): void {
            //
        });
    }
}

// config/essentials.php
return [
    NunoMaduro\Essentials\Configurables\ShouldBeStrict::class => true,
    NunoMaduro\Essentials\Configurables\Unguard::class => false,
    // other configurables...
];
bash
php artisan make:action CreateUserAction
bash
php artisan essentials:pint {--force} {--backup}
bash
php artisan essentials:rector {--force} {--backup}
bash
php artisan vendor:publish --tag=essentials-stubs