A powerful, customizable command runner and log viewer for Laravel Nova 4, developed by Farsi Studio.
farsi/nova-flex-runner is a Laravel package for a powerful, customizable command runner and log viewer for laravel nova 4, developed by farsi studio..
It currently has 0 GitHub stars and 0 downloads on Packagist.
Install it with composer require farsi/nova-flex-runner.
Discover more Laravel packages by farsi
or browse all Laravel packages to compare alternatives.
Last updated
A powerful, customizable command runner and log viewer for Laravel Nova 4, developed by Farsi Studio.
artisan, job, service, shell, and http commands.log filescomposer require farsi/nova-flex-runner
php artisan vendor:publish --tag=nova-flex-runner-config
php artisan vendor:publish --tag=nova-flex-runner-migrations
php artisan migrate
php artisan vendor:publish --tag=nova-flex-runner-assets
The tools are automatically registered via the service provider. No manual registration required.
The package uses the config/nova-flex-runner.php configuration file:
<?php
return [
// Security settings
'security' => [
'require_confirmation' => true,
'log_all_executions' => true,
'max_execution_time' => 300,
],
// Shell command settings
'shell' => [
'enabled' => false, // Enable with caution
'timeout' => 300,
'allowed_commands' => [
'/^git /',
'/^composer /',
],
],
// Command definitions
'commands' => [
// Your command categories here
],
];
Commands are organized into categories. Here's an example configuration:
'commands' => [
'maintenance' => [
'name' => 'Maintenance',
'description' => 'Application maintenance commands',
'icon' => 'wrench-screwdriver',
'commands' => [
[
'name' => 'Clear Application Cache',
'slug' => 'cache-clear',
'description' => 'Clear all application caches',
'type' => 'artisan',
'command' => 'cache:clear',
'confirmation_required' => false,
'inputs' => [],
],
[
'name' => 'Put Application in Maintenance Mode',
'slug' => 'maintenance-down',
'description' => 'Put the application into maintenance mode',
'type' => 'artisan',
'command' => 'down',
'confirmation_required' => true,
'inputs' => [
[
'name' => 'message',
'label' => 'Maintenance Message',
'type' => 'textarea',
'placeholder' => 'We are currently performing maintenance...',
'required' => false,
'is_option' => true,
],
],
],
],
],
],
[
'name' => 'Run Migrations',
'slug' => 'migrate',
'type' => 'artisan',
'command' => 'migrate',
'inputs' => [
[
'name' => 'force',
'label' => 'Force run in production',
'type' => 'checkbox',
'is_option' => true,
],
],
]
[
'name' => 'Process Data',
'slug' => 'process-data',
'type' => 'job',
'job_class' => 'App\\Jobs\\ProcessDataJob',
'queue' => 'default',
'inputs' => [
[
'name' => 'batch_size',
'label' => 'Batch Size',
'type' => 'number',
'min' => 1,
'max' => 1000,
'required' => true,
],
],
]
[
'name' => 'Generate Report',
'slug' => 'generate-report',
'type' => 'service',
'service_class' => 'App\\Services\\ReportService',
'method' => 'generateReport',
'inputs' => [
[
'name' => 'report_type',
'label' => 'Report Type',
'type' => 'select',
'options' => [
['value' => 'daily', 'label' => 'Daily Report'],
['value' => 'weekly', 'label' => 'Weekly Report'],
],
'required' => true,
],
],
]
[
'name' => 'Git Status',
'slug' => 'git-status',
'type' => 'shell',
'command' => 'git status',
'timeout' => 30,
'inputs' => [],
]
[
'name' => 'username',
'label' => 'Username',
'type' => 'text',
'placeholder' => 'Enter username',
'maxlength' => 50,
'required' => true,
]
[
'name' => 'environment',
'label' => 'Environment',
'type' => 'select',
'options' => [
['value' => 'dev', 'label' => 'Development'],
['value' => 'staging', 'label' => 'Staging'],
['value' => 'prod', 'label' => 'Production'],
],
'required' => true,
]
[
'name' => 'timeout',
'label' => 'Timeout (seconds)',
'type' => 'number',
'min' => 1,
'max' => 600,
'step' => 1,
'required' => true,
]
[
'name' => 'features',
'label' => 'Features to Enable',
'type' => 'multiselect',
'options' => [
['value' => 'feature_a', 'label' => 'Feature A'],
['value' => 'feature_b', 'label' => 'Feature B'],
],
]
[
'name' => 'force',
'label' => 'Force execution',
'type' => 'checkbox',
]
[
'name' => 'message',
'label' => 'Message',
'type' => 'textarea',
'rows' => 4,
'placeholder' => 'Enter your message...',
]
You can easily add your own custom input components:
resources/js/components/inputs/'input_types' => [
'custom-input' => [
'component' => 'CustomInput',
'props' => ['custom_prop'],
],
],
The Log Viewer provides comprehensive tracking of all command executions:
.log filesAccess the Log Viewer through the Nova sidebar menu "Command Logs".
⚠️ Important Security Warnings:
db:wipe in production without proper safeguards.Implement custom authorization by defining Gate policies:
// In your AuthServiceProvider
Gate::define('viewNovaFlexRunner', function ($user) {
return $user->hasRole('admin');
});
Gate::define('executeNovaFlexRunner', function ($user) {
return $user->hasRole('admin') || $user->hasRole('developer');
});
Gate::define('viewNovaFlexRunnerLogs', function ($user) {
return $user->hasRole('admin');
});
The package exposes several API endpoints for integration:
GET /nova-vendor/nova-flex-runner/api/commands - List all commandsPOST /nova-vendor/nova-flex-runner/api/execute - Execute a commandGET /nova-vendor/nova-flex-runner/api/status/{log} - Get execution statusGET /nova-vendor/nova-flex-runner/api/logs - List command logsGET /nova-vendor/nova-flex-runner/api/logs/{log}/download - Download log filecomposer test
Contributions are welcome! Please see our contributing guidelines for details.
Please see CHANGELOG for more information on what has changed recently.
The MIT License (MIT). Please see License File for more information.
Developed by Ali Sameni
Maintained by Farsi Studio
For support and updates, visit: https://github.com/farsi/nova-flex-runner