A simple command to run and manage all necessary development servers and commands in separate terminals.
maherremita/laravel-dev is a Laravel package for a simple command to run and manage all necessary development servers and commands in separate terminals..
It currently has 14 GitHub stars and 46 downloads on Packagist (latest version 1.1.2).
Install it with composer require maherremita/laravel-dev.
Discover more Laravel packages by maherremita
or browse all Laravel packages to compare alternatives.
Last updated
A Laravel package that allows you to launch and manage all your development servers and commands in separate terminal windows with a single Artisan command.
https://github.com/user-attachments/assets/9eecce7f-19f2-43ce-9c1c-efa58f5b31ae
A quick demonstration of how Laravel Dev works.
You can install the package via composer:
composer require maherremita/laravel-dev --dev
Next, publish the configuration file using the vendor:publish command. This will create a config/laravel_dev.php file in your project.
php artisan vendor:publish --provider="maherremita\LaravelDev\LaravelDevServiceProvider" --tag="config"
Open the config/laravel_dev.php file and define the commands you want to manage. You can add as many as you need.
Define your commands as usual in the commands array:
'commands' => [
// Simple format
'Laravel Server' => 'php artisan serve',
'Queue Worker' => 'php artisan queue:work',
// Advanced format with custom colors
'Vite Dev Server' => [
'command' => 'npm run dev --watch',
'colors' => [
'text' => 'Green',
'background' => 'Black'
]
],
],
You can also generate commands at runtime, e.g. from the database or other sources. Use the dynamic_commands array for this. Each entry contains PHP code as a string, which is evaluated at runtime and must return an array of commands (like the commands array above).
Example:
'dynamic_commands' => [
'colored_commands' => 'array_reduce(
range(1, 3),
function ($carry, $number) {
$carry["Task {$number}"] = [
"command" => "echo Executing task {$number}",
"colors" => ["text" => "green", "background" => "black"]
];
return $carry;
},
[]
);',
// ...
]
Notes:
eval() and must return an associative array.\' or \").;).Start the master command by running:
php artisan dev
This will launch all the commands defined in your configuration file, each in its own terminal window. You will then see an interactive menu in the original terminal allowing you to manage these processes.
Once running, you can choose from the following actions:
show all commands: Display a list of all configured commands.start command: Start a configured command that is not currently running.start all commands: Start all configured commands.stop command: Stop a specific running command.stop all commands: Stop all currently running commands.restart command: Restart a specific running command.restart all commands: Stop and then start all configured commands.refresh commands: Reload the configuration and update the list of commands.exit: Exit the interactive menu and stop managing processes.You can set the text and background colors for each terminal window.
Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White.black, white, red, green, blue, cyan, magenta, yellow.Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White.Contributions are welcome! Please feel free to submit a pull request.
git checkout -b feature/my-new-feature).git commit -am 'Add some feature').git push origin feature/my-new-feature).The MIT License (MIT). Please see License File for more information.
β Found this package helpful? Give it a star!