{"id":36992279,"url":"https://github.com/brainstudnl/laravel-deployment-scripts","last_synced_at":"2026-01-13T23:44:27.035Z","repository":{"id":62496606,"uuid":"475903161","full_name":"brainstudnl/laravel-deployment-scripts","owner":"brainstudnl","description":"Execute one time scripts during deployment","archived":false,"fork":false,"pushed_at":"2025-07-14T13:34:50.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-24T10:05:13.350Z","etag":null,"topics":["deployment","laravel"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brainstudnl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-30T13:57:21.000Z","updated_at":"2025-07-14T13:34:24.000Z","dependencies_parsed_at":"2022-11-02T09:46:01.759Z","dependency_job_id":null,"html_url":"https://github.com/brainstudnl/laravel-deployment-scripts","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/brainstudnl/laravel-deployment-scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainstudnl%2Flaravel-deployment-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainstudnl%2Flaravel-deployment-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainstudnl%2Flaravel-deployment-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainstudnl%2Flaravel-deployment-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brainstudnl","download_url":"https://codeload.github.com/brainstudnl/laravel-deployment-scripts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainstudnl%2Flaravel-deployment-scripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405188,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deployment","laravel"],"created_at":"2026-01-13T23:44:26.437Z","updated_at":"2026-01-13T23:44:27.030Z","avatar_url":"https://github.com/brainstudnl.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduction\n\nWhen deploying new code you'll sometimes need to execute one time scripts, commands or queries to activate new\nfunctionalities. With a growing application, it is easy to lose sight of which things should be executed for a given\ndeployment. Laravel already has migrations which run after executing the artisan migrate command, but these migrations\nare aimed at database operations only.\n\nThe Laravel one time deployment scripts package aims to solve this problem by offering a migration-like way of\nregistering scripts, commands and queries that should be executed. By simply registering the deployment scripts execute\ncommand, the package will check whether there are any scripts that should be executed. Once a script has been executed\nit will be registered in the database so that it won't run again.\n\n## Example\n\nThe code snippet below is an example of how the deployment script is configured. A regular or an anonymous class is\ncreated which extends the DeploymentScript base class. Then it registers the up and down methods to contain the\ndeployment tasks that need to be executed, and finally within those methods the desired tasks are executed.\n\n```php\nreturn new class extends DeploymentScript {\n\tpublic function up()\n\t{\n\t\t$this-\u003ecommand('mycommand:trigger');\n\n\t\t$this-\u003equery('UPDATE `table` SET `foo` = 1 WHERE `baz` IS NULL');\n\t}\n\t\n\tpublic function down()\n\t{\n\t\t$this-\u003eclosure(function () {\n\t\t\t(new CustomActionClass())-\u003eexecute();\n\t\t});\n\t}\n} \n```\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require brainstud/laravel-deployment-scripts\n```\n\nYou can publish and run the migrations with:\n\n```bash\nphp artisan vendor:publish --tag=\"deployment-scripts-migrations\"\nphp artisan migrate\n```\n\nYou can publish the config file with:\n\n```bash\nphp artisan vendor:publish --tag=\"deployment-scripts-config\"\n```\n\nThis is the content of the published config file:\n\n```php\nreturn [\n    'table_name' =\u003e 'deployment_scripts_log',\n];\n```\n\n## Usage\n\n### Available commands\n\n| Command | Description |\n| --- | --- |\n| deployment-script:make {name} | Create a new deployment script class |\n| deployment-script:execute | Execute the deployment scripts |\n| deployment-script:rollback | Roll back the deployment scripts by one iteration |\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainstudnl%2Flaravel-deployment-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrainstudnl%2Flaravel-deployment-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainstudnl%2Flaravel-deployment-scripts/lists"}