PHP code example of supplycart / domains

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

    

supplycart / domains example snippets




declare(strict_types=1);

use App\Domains\User\User;

return [
    'modules' => [
        User::class,
    ],
];



declare(strict_types=1);

namespace App\Domains\User;

use Supplycart\Domains\Domain;

final class User extends Domain
{
    public static function registerRoutes(): void
    {
        

->withEvents(discover: [
    __DIR__.'/../app/Domains/*/Listeners',
])
bash
php artisan make:domain User
bash
php artisan make:domain User --queues
bash
php artisan optimize