1. Go to this page and download the library: Download grnspc/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/ */
grnspc / essentials example snippets
declare(strict_types=1);
namespace App\Actions;
use Illuminate\Database\DatabaseManager;
use Throwable;
final readonly class CreateUserAction
{
public function __construct(private DatabaseManager $database) {}
/**
* Execute the action.
*
* @throws Throwable
*/
public function handle(): void
{
$this->database->transaction(
callback: function (): void => {
//
},
attempts: 3
);
}
}