Prerequisites: Ensure your project meets the updated requirements:
composer require cleverage/ui-process-bundle
First Use Case: Create a UI process with a user via CLI:
php artisan cleverage:ui-process:user-create --username=testuser --password=securepass
(Note: --username/--password args are now supported; see #57.)
Key Files:
config/cleverage_ui_process.php (check for Symfony 7.3+ config structure).vendor/cleverage/ui-process-bundle/ (source for extension points).Process Definition:
config/cleverage_ui_process.php under processes.steps: array with command: keys).'processes' => [
'example' => [
'steps' => [
['command' => 'php artisan queue:work'],
['command' => 'php artisan cache:clear'],
],
],
],
CLI Integration:
cleverage:ui-process:run command to execute processes:
php artisan cleverage:ui-process:run example
--option=value (e.g., --env=production).User Management:
--username/--password):
$this->call('cleverage:ui-process:user-create', [
'--username' => 'admin',
'--password' => 'P@ssw0rd',
]);
ProcessStarted) via Event::dispatch().ProcessBundle's Process class.Process and Console components for custom logic (e.g., logging, error handling).PHP 8.1+ Requirement:
array() or foreach with non-object iterables may fail.array_map() for strict types).TypeError in logs when running commands.Symfony 7.3+:
!tagged services → tags: []).composer dump-autoload and validate config structure.CLI Argument Parsing:
--username/--password to user-create will throw MissingArgumentException.--help for command-specific args:
php artisan cleverage:ui-process:user-create --help
Process Isolation:
cache()) unless explicitly synchronized.ProcessBundle's Process::mustRun() for blocking calls.Custom Commands:
php artisan make:command CustomProcessCommand
Cleverage\UiProcessBundle\Command\ProcessRunner to reuse logic.Event Listeners:
ProcessStarted/ProcessFailed events to add pre/post hooks:
public function handle(ProcessStarted $event) {
Log::info('Process ID: '.$event->getProcess()->getId());
}
Configuration Overrides:
php artisan vendor:publish --tag=cleverage-ui-process-config
processes array in config/cleverage_ui_process.php.-vvv to CLI commands for Symfony debug logs.storage/logs/laravel.log for subprocess errors (e.g., command failures).str_contains() or array_is_list() if upgrading to PHP 8.4.How can I help you explore Laravel packages today?