PHPackages                             edgrosvenor/adhoc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. edgrosvenor/adhoc

ActiveLibrary[CLI &amp; Console](/categories/cli)

edgrosvenor/adhoc
=================

Allow Laravel commands to accept ad hoc arguments and options

0.1.1(6y ago)04[2 issues](https://github.com/edgrosvenor/adhoc/issues)MITPHPPHP ^7CI failing

Since Oct 16Pushed 6y ago1 watchersCompare

[ Source](https://github.com/edgrosvenor/adhoc)[ Packagist](https://packagist.org/packages/edgrosvenor/adhoc)[ Docs](https://github.com/edgrosvenor/adhoc)[ RSS](/packages/edgrosvenor-adhoc/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Ad Hoc Arguments for Laravel Commands
=====================================

[](#ad-hoc-arguments-for-laravel-commands)

[![StyleCI](https://camo.githubusercontent.com/bbb2baade0a62e338655c47d831ec8ab35357182028c3fe9da5b5dae88fec8fe/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3231343537323630362f736869656c643f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/bbb2baade0a62e338655c47d831ec8ab35357182028c3fe9da5b5dae88fec8fe/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3231343537323630362f736869656c643f6272616e63683d6d6173746572)[![ChipperCI](https://camo.githubusercontent.com/eafb15fd7dada7ae9eee754c5ab8f03f1de8f66166d77161d37f7aaa2dc315a3/68747470733a2f2f6170702e6368697070657263692e636f6d2f70726f6a656374732f32316638393430372d316662342d343638632d396333652d6334363631616530646338392f7374617475732f6d6173746572)](https://camo.githubusercontent.com/eafb15fd7dada7ae9eee754c5ab8f03f1de8f66166d77161d37f7aaa2dc315a3/68747470733a2f2f6170702e6368697070657263692e636f6d2f70726f6a656374732f32316638393430372d316662342d343638632d396333652d6334363631616530646338392f7374617475732f6d6173746572)[![Latest Version on Packagist](https://camo.githubusercontent.com/67f75600bf19eda56ec5acf4679519676b646f0a5bf1e2adce061b32ba254e96/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656467726f7376656e6f722f6164686f632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/edgrosvenor/adhoc)

Allows the use of arguments in Laravel commands that are not defined in the signature. I'm not sure why you would ever want this. I know why I wanted it, but I'm reckless. So use at your own risk.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require edgrosvenor/adhoc
```

Usage
-----

[](#usage)

Create your commands as normal, but have them extend Adhoc\\Command instead. Then any arguments you send to the command will set as attributes on the command object. So for instance, if you do:

```
php artisan do:something packages=fun
```

where adhoc is not in the signature of the command, in the execute method you can access it like this:

```
$this->packages; // fun
```

and you can access an array of the arguments passed like so:

```
$this->_adhoc; // ['packages']
```

Todo
----

[](#todo)

I would like to find a cleaner way to extract the arguments. Without doing naughty things to the Symfony console, I can only seem to get the input as a string so I have to parse it by hand. It works, but I don't like the way it loks.

I also don't put arguments into the arguments array that Laravelians usually use to get arguments passed to their commands. So if you reach for `$this->arguments('myadhocargument')` it won't be there. I think mabye I should add it.

Finally, I think I might have a personal use case for ad hoc options. But until I am happier with how I'm extracting arguments I don't want to mess with options.

Credits
-------

[](#credits)

- [Ed Grosvenor](https://github.com/exactsports)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2397d ago

PHP version history (2 changes)0.1.0PHP ^7.1

0.1.1PHP ^7

### Community

Maintainers

![](https://www.gravatar.com/avatar/55eed7400c452edf7e7adfa4f1c6676b65b5ce1867fff6bddcb80b1bb45360af?d=identicon)[edgrosvenor](/maintainers/edgrosvenor)

---

Top Contributors

[![edgrosvenor](https://avatars.githubusercontent.com/u/1053395?v=4)](https://github.com/edgrosvenor "edgrosvenor (13 commits)")

---

Tags

laravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/edgrosvenor-adhoc/health.svg)

```
[![Health](https://phpackages.com/badges/edgrosvenor-adhoc/health.svg)](https://phpackages.com/packages/edgrosvenor-adhoc)
```

###  Alternatives

[nunomaduro/laravel-console-menu

Laravel Console Menu is an output method for your Laravel/Laravel Zero commands.

815412.0k47](/packages/nunomaduro-laravel-console-menu)[mwguerra/web-terminal

A web-based terminal component for Filament/Laravel with command whitelisting and multiple connection types

251.1k](/packages/mwguerra-web-terminal)[sunaoka/laravel-facade-generator

Provide command line generation of facade layer files.

171.9k](/packages/sunaoka-laravel-facade-generator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
