DevCommands
class DevCommands (View source)
Properties
| static protected NodePackageManager|null | $packageManager | The resolved NodePackageManager instance. |
|
| static protected int | $colorCount | Counter to keep track of how many colors have been assigned,. |
|
| static protected array | $commands | The registered development commands. |
|
| static protected array<int, string> | $only | The names of commands that should be included when running the "dev" command. |
|
| static protected array<int, string> | $except | The names of commands that should be excluded when running the "dev" command. |
Methods
Register the default development commands.
Register a development command.
Registers an Artisan command, automatically prefixing it with "php artisan".
Registers a Node command, automatically prefixing it with the detected package manager's run command.
Registers a Node command, automatically prefixing it with the detected package manager's exec command.
Get the registered development commands.
Fill in any empty colors in the given commands array, ensuring each command has a color assigned.
Get a color for a command, ensuring that colors are reused only after all available colors have been used at least once.
Resolve the first external caller frame from a debug backtrace.
Determine the registration priority from a debug backtrace.
Set the commands that should be included when running the "dev" command.
Set the commands that should be excluded when running the "dev" command.
Resolve and return the NodePackageManager instance.
Details
static void
registerDefaults()
Register the default development commands.
static DevCommand
register(string $command, string|null $name = null)
Register a development command.
static DevCommand
artisan(string $command, string|null $name = null)
Registers an Artisan command, automatically prefixing it with "php artisan".
static DevCommand
node(string $command, string|null $name = null)
Registers a Node command, automatically prefixing it with the detected package manager's run command.
static DevCommand
nodeExec(string $command, string|null $name = null)
Registers a Node command, automatically prefixing it with the detected package manager's exec command.
static array
commands()
Get the registered development commands.
static protected array
fillInEmptyColors(array $commands)
Fill in any empty colors in the given commands array, ensuring each command has a color assigned.
static protected string
getColor(array $commands)
Get a color for a command, ensuring that colors are reused only after all available colors have been used at least once.
static protected array
resolveSource(array $trace)
Resolve the first external caller frame from a debug backtrace.
static protected int
resolvePriority(array $trace)
Determine the registration priority from a debug backtrace.
static void
only(string ...$names)
Set the commands that should be included when running the "dev" command.
static void
except(string ...$names)
Set the commands that should be excluded when running the "dev" command.
static protected NodePackageManager
getPackageManager()
Resolve and return the NodePackageManager instance.
Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.