### Run the automated installation script Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Runs the automated installation script that installs Composer dependencies, sets up the environment, generates the application key, configures the database, runs migrations, installs Node.js dependencies, builds assets, and configures Herd if used. ```bash php install.php ``` -------------------------------- ### Set up environment and generate application key Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Sets up the environment file by copying the example and generating the application key. ```bash cp .env.example .env php artisan key:generate ``` -------------------------------- ### Copy environment file Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Copies the example environment file to create the .env configuration file. ```bash cp .env.example .env ``` -------------------------------- ### Run the development server Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Starts the Laravel development server. ```bash php artisan serve ``` -------------------------------- ### Create a new project using FilaKit CLI Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Uses the FilaKit CLI to create a new application with the MFAKit starter kit. Requires the FilaKit CLI to be installed globally via Composer. ```bash filakit new my-app --kit=jeffersongoncalves/mfakitv5 ``` -------------------------------- ### Require MFA before panel access Source: https://github.com/jeffersongoncalves/mfakitv5/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. Default setup URLs are /admin/multi-factor-authentication/set-up for Admin and /app/multi-factor-authentication/set-up for App. ```php // In your Panel provider (Admin/App) ->requiresMultiFactorAuthentication() ``` -------------------------------- ### Install Composer dependencies Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Installs Composer (PHP) dependencies. ```bash composer install ``` -------------------------------- ### Customize MFA route prefix and setup slug Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Customize the route parts for the MFA setup flow. The prefix defaults to 'multi-factor-authentication' and the slug defaults to 'set-up'. Adjust these to change the setup URLs. ```php ->multiFactorAuthenticationRoutePrefix('mfa') // default: "multi-factor-authentication" ->setUpRequiredMultiFactorAuthenticationRouteSlug('setup') // default: "set-up" ``` -------------------------------- ### Install JavaScript dependencies Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Installs JavaScript dependencies using pnpm. ```bash pnpm install ``` -------------------------------- ### Start Sail containers Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Starts the Laravel Sail containers in detached mode. The development server is automatically handled by Sail, so `php artisan serve` is not needed. ```bash ./vendor/bin/sail up -d ``` -------------------------------- ### Configure custom ports in .env Source: https://github.com/jeffersongoncalves/mfakitv5/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 ``` -------------------------------- ### Send WhatsApp messages via Filament actions Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Attach SendWhatsappMessageAction to a resource table or page header. The header example shows optional 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!'), ]; } ``` -------------------------------- ### Navigate into project directory Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Moves into the newly created project directory. ```bash cd my-app ``` -------------------------------- ### Create a new Laravel project with MFAKit Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Creates a new Laravel application using the MFAKit starter kit template with MySQL as the database. ```bash laravel new my-app --using=jeffersongoncalves/mfakitv5 --database=mysql ``` -------------------------------- ### Publish config and run migrations Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Publishes the plugin's config and migration files, then runs the migrations. Required before using the WhatsApp Connector plugin. ```bash php artisan vendor:publish --tag="filament-evolution-config" php artisan vendor:publish --tag="filament-evolution-migrations" php artisan migrate ``` -------------------------------- ### Build frontend assets Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Builds frontend assets using pnpm. ```bash pnpm run build ``` -------------------------------- ### Run database migrations Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Runs database migrations. ```bash php artisan migrate ``` -------------------------------- ### Configure filament-evolution.php options Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Optional configuration for the plugin after publishing. Tune queue, storage, cleanup, instance defaults, and tenancy settings. ```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', ], ]; ``` -------------------------------- ### Run development server Source: https://github.com/jeffersongoncalves/mfakitv5/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 ``` -------------------------------- ### Configure media storage environment variables Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Optional environment variables for media storage. You can also specify a custom disk per action with SendWhatsappMessageAction::make()->disk('s3'). ```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/mfakitv5/blob/main/README.md Configure the default MFA providers in the Filament panel provider. AppAuthentication uses TOTP with authenticator apps; the recoverable() option enables recovery codes. EmailAuthentication sends codes via email, and WhatsAppAuthentication requires the WhatsApp Connector to be configured and connected. ```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) ]) ``` -------------------------------- ### Configure Evolution API environment variables Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Environment variables for the Evolution API connection and webhook settings. Required: EVOLUTION_URL, EVOLUTION_API_KEY, and EVOLUTION_WEBHOOK_URL. Optional: EVOLUTION_WEBHOOK_SECRET and EVOLUTION_DEFAULT_INSTANCE. ```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 ``` -------------------------------- ### Prefill SendWhatsappMessageAction from record Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Prefill the action's number and instance from record attributes using numberFrom and instanceFrom. ```php SendWhatsappMessageAction::make() ->numberFrom('phone') // attribute on the record ->instanceFrom('whatsapp_instance_id'); ``` -------------------------------- ### Generate application key Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Generates the application encryption key. ```bash php artisan key:generate ``` -------------------------------- ### Schedule evolution:cleanup daily Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Schedule the cleanup command to run daily in routes/console.php. ```php // routes/console.php use Illuminate\Support\Facades\Schedule; Schedule::command('evolution:cleanup')->daily(); ``` -------------------------------- ### Attach to application container Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Attaches to the application container to run commands inside it. ```bash ./vendor/bin/sail shell ``` -------------------------------- ### Run evolution:cleanup command Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Cleanup command to remove old webhook/message records. Supports --dry-run and custom retention days. ```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 ``` -------------------------------- ### Limit message types and hide fields Source: https://github.com/jeffersongoncalves/mfakitv5/blob/main/README.md Limit allowed message types and hide fields on the action. Uses MessageTypeEnum and methods like hideInstanceSelect, hideNumberInput, and textOnly. ```php use WallaceMartinss\FilamentEvolution\Enums\MessageTypeEnum; SendWhatsappMessageAction::make() ->allowedTypes([MessageTypeEnum::TEXT, MessageTypeEnum::IMAGE]) ->hideInstanceSelect() ->hideNumberInput() ->textOnly(); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.