| Package Data | |
|---|---|
| Maintainer Username: | yuanben |
| Maintainer Contact: | i@dearmadman.com (Dearmadman) |
| Package Create Date: | 2017-04-28 |
| Package Last Update: | 2017-05-14 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-11-03 15:12:22 |
| Package Statistics | |
|---|---|
| Total Downloads: | 1,040 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 3 |
| Total Watchers: | 1 |
| Total Forks: | 0 |
| Total Open Issues: | 0 |
To get started with Command Once, add to your composer.json file as a dependency:
composer require yuanben/laravel-command-once
After installing the Command Once library, register the Yuanben\CommandOnce\CommandOnceServiceProvider in your config/app.php configuration file:
'providers' => [
// Other service providers...
Yuanben\CommandOnce\CommandOnceServiceProvider::class,
]
Next, you need execute publish command:
php artisan vendor:publish
This command will publish command.php config file to you application config directory. also, it will publish create command once table migration file to you migration directory. So, you also need to do migrate:
php artisan migrate
Within command.php file, you need list what commands do you want execute just only once:
return [
'execs' => [
'storage:link' => 'v0.0.1',
'db:seed' => 'my version',
'cache:clear {--help:} {store:redis} => 'version',
'!ls -al' => 'version'
]
];
Then you can execute command like this:
php artisan command:once
This command will compare the listed command and version above with the database, if they never executed, the command will do it for you.