- This package publishes a config/post_script.php file. If you already have a file by that name, please rename or remove it.
- You can install the package via composer:
composer require tangoslee/post-script
- Optional: The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php file:
'providers' => [
// ...
Tangoslee\PostScript\PostScriptServiceProvider::class,
];
- You should publish the migration and the config/post_script.php config file with:
php artisan vendor:publish --provider="Tangoslee\PostScript\PostScriptServiceProvider"
- Run the migrations: After the config and migration have been published and configured, you can create the tables for this package by running:
php artisan migrate
php artissan make:post-script foo_bar
- output example
/home/user/project/post-scripts/2024/08/2024_08_19_125037_foo_bar.sh created
- Edit a shell script
php artisan post-script:status
- output example
+------+------------------------------+------------+----+
| Ran? | Script | Batch | ID |
+------+------------------------------+------------+----+
| Yes | 2024_08_09_123456_script.sh | 1723977236 | 1 |
| No | 2024_08_19_125037_foo_bar.sh | | |
+------+------------------------------+------------+----+
php artisan post-script:run
- example. If you want to run ID 1 script again for some reason.
+------+------------------------------+------------+----+
| Ran? | Script | Batch | ID |
+------+------------------------------+------------+----+
| Yes | 2024_08_09_123456_script.sh | 1723977236 | 1 |
| No | 2024_08_19_125037_foo_bar.sh | | |
+------+------------------------------+------------+----+
php artisan post-script:run --replay 1