{"id":41878031,"url":"https://github.com/halilcosdu/laravel-command-banner","last_synced_at":"2026-01-25T12:39:25.513Z","repository":{"id":239363548,"uuid":"799331564","full_name":"halilcosdu/laravel-command-banner","owner":"halilcosdu","description":"★ Laravel Command Banner: Prevents commands from running in defined environments","archived":false,"fork":false,"pushed_at":"2025-08-12T09:44:40.000Z","size":38,"stargazers_count":9,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-01T19:22:44.296Z","etag":null,"topics":["artisan","block","command-line","environmens","laravel","php"],"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/halilcosdu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"buy_me_a_coffee":"halilcosdu5"}},"created_at":"2024-05-11T20:11:19.000Z","updated_at":"2025-07-29T02:40:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"4334f426-ec96-4f67-9d00-24fa52521e88","html_url":"https://github.com/halilcosdu/laravel-command-banner","commit_stats":null,"previous_names":["halilcosdu/laravel-command-banner"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/halilcosdu/laravel-command-banner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halilcosdu%2Flaravel-command-banner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halilcosdu%2Flaravel-command-banner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halilcosdu%2Flaravel-command-banner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halilcosdu%2Flaravel-command-banner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/halilcosdu","download_url":"https://codeload.github.com/halilcosdu/laravel-command-banner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halilcosdu%2Flaravel-command-banner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28753209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T10:25:12.305Z","status":"ssl_error","status_checked_at":"2026-01-25T10:25:11.933Z","response_time":113,"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":["artisan","block","command-line","environmens","laravel","php"],"created_at":"2026-01-25T12:39:24.102Z","updated_at":"2026-01-25T12:39:25.501Z","avatar_url":"https://github.com/halilcosdu.png","language":"PHP","funding_links":["https://buymeacoffee.com/halilcosdu5"],"categories":[],"sub_categories":[],"readme":"# ★ Laravel Command Banner: Prevents commands from running in defined environments\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/halilcosdu/laravel-command-banner.svg?style=flat-square)](https://packagist.org/packages/halilcosdu/laravel-command-banner)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/halilcosdu/laravel-command-banner/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/halilcosdu/laravel-command-banner/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/halilcosdu/laravel-command-banner/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\u0026style=flat-square)](https://github.com/halilcosdu/laravel-command-banner/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/halilcosdu/laravel-command-banner.svg?style=flat-square)](https://packagist.org/packages/halilcosdu/laravel-command-banner)\n\n\nThe \"Laravel Command Banner\" is a package designed to provide control over the execution of artisan commands in different environments. It allows developers to define which commands should be prevented from running in specific environments, enhancing the security and stability of the application.  The package works by listening to the CommandStarting event in Laravel. When a command is about to start, it checks the package's configuration to see if the command is allowed to run in the current environment. If the command is not allowed, it outputs an error message and stops the execution of the command.  This package is particularly useful in scenarios where certain commands can have destructive effects if run in the wrong environment, such as a production environment. By using this package, developers can ensure that such commands are only run in safe environments, such as local or staging environments.\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require halilcosdu/laravel-command-banner\n```\n\nYou can publish the config file with:\n\n```bash\nphp artisan vendor:publish --tag=\"command-banner-config\"\n```\n\nThis is the contents of the published config file:\n\nYou can add as many environments and different commands to the configuration file as you need.\n\nThe package will prevent the commands listed in the configuration file from running in the specified environments.\n\n```php\n\u003c?php\n\nreturn [\n    'enabled' =\u003e env('COMMAND_BANNER_ENABLED', true),\n    'environments' =\u003e [\n        'production' =\u003e [\n            'db:wipe',\n            'migrate:fresh',\n        ],\n        'staging' =\u003e [\n            //   'db:show'\n        ],\n    ],\n];\n\n\n```\n\n### Example Screen\n\n\u003ca href=\"https://i.ibb.co/NNXVWSr/Screenshot-2024-05-11-at-22-01-46.png\"\u003e\n\u003cimg src=\"https://i.ibb.co/NNXVWSr/Screenshot-2024-05-11-at-22-01-46.png\" alt=\"Screenshot\" style=\"width:100%;\"\u003e\n\u003c/a\u003e\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## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Halil Cosdu](https://github.com/halilcosdu)\n- [All Contributors](../../contributors)\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%2Fhalilcosdu%2Flaravel-command-banner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalilcosdu%2Flaravel-command-banner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalilcosdu%2Flaravel-command-banner/lists"}