### Run easy installation script Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Automates the full installation: Composer dependencies, environment setup, key generation, database setup, migrations, Node dependencies, asset building, and Herd configuration if used. ```bash php install.php ``` -------------------------------- ### Create a new project with FilaKit CLI Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Alternative installation using the FilaKit CLI. Requires the CLI to be installed globally via Composer. ```bash filakit new my-app --kit=jeffersongoncalves/mfakitv4 ``` -------------------------------- ### Set up environment file Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Copies the example environment file to create the .env configuration file. ```bash cp .env.example .env ``` -------------------------------- ### Install FilaKit CLI globally Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Install the FilaKit CLI tool globally via Composer, required for the FilaKit CLI installation method. ```bash composer global require jeffersongoncalves/filakit-cli ``` -------------------------------- ### Install JavaScript dependencies Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Install Node.js dependencies using PNPM. Required before building frontend assets. ```bash pnpm install ``` -------------------------------- ### Set up environment file and generate key Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Copy the example environment file and generate the application key. Configure the database in the .env file afterward. ```bash cp .env.example .env php artisan key:generate ``` -------------------------------- ### Install Composer dependencies Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Install PHP dependencies via Composer. ```bash composer install ``` -------------------------------- ### Run the development server Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Start the Laravel development server. ```bash php artisan serve ``` -------------------------------- ### Create a new project with Laravel installer Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Use this command to create a new Laravel project using the MFAKit starter kit template. Requires PHP 8.3+, Composer, and MySQL database. ```bash laravel new my-app --using=jeffersongoncalves/mfakitv4 --database=mysql ``` -------------------------------- ### Customize MFA setup route prefix and slug Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Customize the URL route parts for the MFA setup flow. The default prefix is 'multi-factor-authentication' and the default slug is 'set-up'. ```php ->multiFactorAuthenticationRoutePrefix('mfa') // default: "multi-factor-authentication" ->setUpRequiredMultiFactorAuthenticationRouteSlug('setup') // default: "set-up" ``` -------------------------------- ### Build frontend assets Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Build frontend assets using PNPM. Requires JavaScript dependencies installed. ```bash pnpm run build ``` -------------------------------- ### Start Sail containers Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Starts the Laravel Sail containers in detached mode. Laravel Sail automatically handles the development server, so `php artisan serve` is not needed. ```bash ./vendor/bin/sail up -d ``` -------------------------------- ### Configure custom ports in .env Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Example environment variables for configuring custom ports for the application, MySQL, Redis, and Mailpit. Adjust these if other services are using the default ports. ```bash # Application Port (ex: 8080) APP_PORT=8080 # MySQL Port (ex: 3306) FORWARD_DB_PORT=3306 # Redis Port (ex: 6379) FORWARD_REDIS_PORT=6379 # Mailpit Port (ex: 1025) FORWARD_MAILPIT_PORT=1025 ``` -------------------------------- ### Schedule cleanup command Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Example to schedule the cleanup command daily using Laravel's Schedule facade. ```php // routes/console.php use Illuminate\Support\Facades\Schedule; Schedule::command('evolution:cleanup')->daily(); ``` -------------------------------- ### Require MFA before panel access Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Require users to set up MFA before accessing the panel. When enabled, users are redirected to the MFA setup screen until they finish enabling at least one provider. ```php // In your Panel provider (Admin/App) ->requiresMultiFactorAuthentication() ``` -------------------------------- ### SendWhatsappMessageAction usage in Filament UI Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Examples to attach the SendWhatsappMessageAction to a resource table or page header, showcasing defaults for number and message. ```php use WallaceMartinss\FilamentEvolution\Actions\SendWhatsappMessageAction; // In a resource table public function table(Table $table): Table { return $table ->actions([ SendWhatsappMessageAction::make(), ]); } // In a page header protected function getHeaderActions(): array { return [ SendWhatsappMessageAction::make() // Optional sensible defaults ->number('5511999999999') ->message('Hello from MFAKit!'), ]; } ``` -------------------------------- ### Limit message types or hide fields Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Restrict allowed message types and hide select and number input fields, with an example of text-only mode. ```php use Wallacea\FilamentEvolution\Enums\MessageTypeEnum; SendWhatsappMessageAction::make() ->allowedTypes([MessageTypeEnum::TEXT, MessageTypeEnum::IMAGE]) ->hideInstanceSelect() ->hideNumberInput() ->textOnly(); ``` -------------------------------- ### Navigate to project directory Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Moves into the project directory after cloning the repository. ```bash cd my-app ``` -------------------------------- ### Publish config and run migrations Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Commands to publish the plugin's config and migration files, followed by running migrations to set up the database tables. ```bash php artisan vendor:publish --tag="filament-evolution-config" php artisan vendor:publish --tag="filament-evolution-migrations" php artisan migrate ``` -------------------------------- ### Run database migrations Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Run the database migrations after configuring the database in the .env file. ```bash php artisan migrate ``` -------------------------------- ### Optional configuration for queues, storage, cleanup, tenancy Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Publishing the plugin's config file and adjusting settings for queues, storage, cleanup, and tenancy. ```php return [ 'queue' => [ 'enabled' => true, 'connection' => null, // default connection 'name' => 'default', ], 'storage' => [ 'webhooks' => true, // persist webhook payloads 'messages' => true, // persist sent/received messages ], 'cleanup' => [ 'webhooks_days' => 30, 'messages_days' => 90, ], 'instance' => [ 'reject_call' => false, 'always_online' => false, // ...other defaults ], 'tenancy' => [ 'enabled' => false, 'column' => 'team_id', 'table' => 'teams', 'model' => 'App\\Models\\Team', ], ]; ``` -------------------------------- ### Prefilling number and instance from record attributes Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Configure the action to prefill the phone number and WhatsApp instance from record attributes. ```php SendWhatsappMessageAction::make() ->numberFrom('phone') // attribute on the record ->instanceFrom('whatsapp_instance_id'); ``` -------------------------------- ### Run development server and queues Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Development commands: `composer dev` runs the development server with logs, queues, and asset compilation. Alternatively, run each component separately with `php artisan serve`, `php artisan queue:listen --tries=1`, and `pnpm run dev`. ```bash # Run the development server with logs, queues and asset compilation composer dev # Or run each component separately php artisan serve php artisan queue:listen --tries=1 pnpm run dev ``` -------------------------------- ### Media storage environment variables Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Optional environment variables for setting the disk, directory, and maximum file size for media. ```env EVOLUTION_MEDIA_DISK=public EVOLUTION_MEDIA_DIRECTORY=whatsapp-media EVOLUTION_MEDIA_MAX_SIZE=16384 ``` -------------------------------- ### Configure MFA providers in Filament panel provider Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Configure the MFA providers for a Filament panel. The AppAuthentication provider uses TOTP with authenticator apps and the recoverable() option enables recovery codes. EmailAuthentication sends codes via email, and WhatsAppAuthentication requires the WhatsApp Connector to be configured. ```php // In app/Providers/Filament/AdminPanelProvider.php and AppPanelProvider.php ->multiFactorAuthentication([ AppAuthentication::make() ->brandName('MFA Kit Demo') ->recoverable(), // allows recovery codes EmailAuthentication::make(), WhatsAppAuthentication::make(), // requires WhatsApp connector setup (see section below) ]) ``` -------------------------------- ### Generate application key Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Generates the application encryption key. ```bash php artisan key:generate ``` -------------------------------- ### Environment variables for Evolution API Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Required and optional environment variables for connecting to the Evolution API and configuring webhook and defaults. ```env # Evolution API connection (required) EVOLUTION_URL=https://your-evolution-api.com EVOLUTION_API_KEY=your_api_key # Webhook URL (required to receive events) # Use the public URL to your app’s webhook endpoint (see below): EVOLUTION_WEBHOOK_URL=https://your-app.com/api/webhooks/evolution # Optional security secret (recommended) EVOLUTION_WEBHOOK_SECRET=your_secret_key # Optional defaults (useful for single-instance setups) EVOLUTION_DEFAULT_INSTANCE=your_instance_id ``` -------------------------------- ### Cleanup command usage Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Command lines to automatically remove old webhook/message records, including dry-run and custom days options. ```bash php artisan evolution:cleanup # uses config defaults php artisan evolution:cleanup --dry-run # preview deletions php artisan evolution:cleanup --webhooks-days=7 --messages-days=30 ``` -------------------------------- ### Attach to application container Source: https://github.com/jeffersongoncalves/mfakitv4/blob/main/README.md Attaches to the application container's shell to run commands inside the container. ```bash ./vendor/bin/sail shell ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.