{"id":29817090,"url":"https://github.com/cybercog/laravel-nova-ban","last_synced_at":"2025-07-28T20:12:13.388Z","repository":{"id":55415167,"uuid":"145874233","full_name":"cybercog/laravel-nova-ban","owner":"cybercog","description":"Laravel Nova Ban simplify blocking and banning Eloquent models.","archived":false,"fork":false,"pushed_at":"2022-08-26T04:19:21.000Z","size":32,"stargazers_count":40,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-08T23:16:14.288Z","etag":null,"topics":["access","arrest","ban","block","cog","forbid","jail","justice","laravel","laravel-nova","nova","prison","restrict","security","user"],"latest_commit_sha":null,"homepage":"https://komarev.com/sources/laravel-nova-ban","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/cybercog.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-23T15:39:28.000Z","updated_at":"2023-07-22T01:26:48.000Z","dependencies_parsed_at":"2022-08-14T23:50:37.992Z","dependency_job_id":null,"html_url":"https://github.com/cybercog/laravel-nova-ban","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/cybercog/laravel-nova-ban","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cybercog%2Flaravel-nova-ban","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cybercog%2Flaravel-nova-ban/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cybercog%2Flaravel-nova-ban/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cybercog%2Flaravel-nova-ban/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cybercog","download_url":"https://codeload.github.com/cybercog/laravel-nova-ban/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cybercog%2Flaravel-nova-ban/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267578003,"owners_count":24110351,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["access","arrest","ban","block","cog","forbid","jail","justice","laravel","laravel-nova","nova","prison","restrict","security","user"],"created_at":"2025-07-28T20:12:12.560Z","updated_at":"2025-07-28T20:12:13.370Z","avatar_url":"https://github.com/cybercog.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Nova Ban\n\n![cog-laravel-nova-ban](https://user-images.githubusercontent.com/1849174/44558292-ffc0a080-a74b-11e8-8699-a79de865910d.png)\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/cybercog/laravel-nova-ban/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release/cybercog/laravel-nova-ban.svg?style=flat-square\" alt=\"Releases\"\u003e\u003c/a\u003e\n\u003ca href=\"https://styleci.io/repos/145874233\"\u003e\u003cimg src=\"https://styleci.io/repos/145874233/shield\" alt=\"StyleCI\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/cybercog/laravel-nova-ban/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/cybercog/laravel-nova-ban.svg?style=flat-square\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Introduction\n\nBehind the scenes [cybercog/laravel-ban](https://github.com/cybercog/laravel-ban) is used.\n\n![laravel-nova-ban-preview](https://user-images.githubusercontent.com/1849174/44547881-1b648080-a725-11e8-9472-bad1486c06f0.png)\n\n## Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Prepare bannable model](#prepare-bannable-model)\n  - [Prepare bannable model database table](#prepare-bannable-model-database-table)\n  - [Register Ban Actions in Nova Resource](#register-ban-actions-in-nova-resource)\n- [Contributing](#contributing)\n- [Testing](#testing)\n- [Security](#security)\n- [Contributors](#contributors)\n- [Alternatives](#alternatives)\n- [License](#license)\n- [About CyberCog](#about-cybercog)\n\n## Installation\n\nPull in the package through Composer.\n\n```shell script\ncomposer require cybercog/laravel-nova-ban\n```\n\n## Usage\n\n### Prepare bannable model\n\n```php\nuse Cog\\Contracts\\Ban\\Bannable as BannableContract;\nuse Cog\\Laravel\\Ban\\Traits\\Bannable;\nuse Illuminate\\Foundation\\Auth\\User as Authenticatable;\n\nclass User extends Authenticatable implements BannableContract\n{\n    use Bannable;\n}\n```\n\n### Prepare bannable model database table\n\nBannable model must have `nullable timestamp` column named `banned_at`. This value used as flag and simplify checks if user was banned. If you are trying to make default Laravel User model to be bannable you can use example below.\n\n#### Create a new migration file\n\n```shell script\nphp artisan make:migration add_banned_at_column_to_users_table\n```\n\nThen insert the following code into migration file:\n\n```php\n\u003c?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass AddBannedAtColumnToUsersTable extends Migration\n{\n    public function up(): void\n    {\n        Schema::table('users', function (Blueprint $table) {\n            $table-\u003etimestamp('banned_at')-\u003enullable();\n        });\n    }\n    \n    public function down(): void\n    {\n        Schema::table('users', function (Blueprint $table) {\n            $table-\u003edropColumn('banned_at');\n        });\n    }\n}\n```\n\nApply new migration.\n\n### Register Ban Actions in Nova Resource\n\nRegister `Ban` and `Unban` actions inside your `Bannable` Model's Resource.\n\n```php\npublic function actions(Request $request)\n{\n    return [\n        new \\Cog\\Laravel\\Nova\\Ban\\Actions\\Ban(),\n        new \\Cog\\Laravel\\Nova\\Ban\\Actions\\Unban(),\n    ];\n}\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Testing\n\nRun the tests with:\n\n```shell script\nvendor/bin/phpunit\n```\n\n## Security\n\nIf you discover any security related issues, please email open@cybercog.su instead of using the issue tracker.\n\n## Contributors\n\n| \u003ca href=\"https://github.com/antonkomarev\"\u003e![@antonkomarev](https://avatars.githubusercontent.com/u/1849174?s=110)\u003cbr /\u003eAnton Komarev\u003c/a\u003e | \u003ca href=\"https://github.com/ sergiy-petrov \"\u003e![@ sergiy-petrov ](https://avatars.githubusercontent.com/u/8986207?s=110)\u003cbr /\u003eSergiy Petrov\u003c/a\u003e | \u003ca href=\"https://github.com/mvdnbrk\"\u003e![@mvdnbrk](https://avatars.githubusercontent.com/u/802681?s=110)\u003cbr /\u003eMark van den Broek\u003c/a\u003e | \u003ca href=\"https://github.com/tooshay\"\u003e![@tooshay](https://avatars.githubusercontent.com/u/703589?s=110)\u003cbr /\u003eRoy Shay\u003c/a\u003e |\n| :---: | :---: | :---: | :---: |\n\n[Laravel Nova Ban contributors list](../../contributors)\n\n## Alternatives\n\n*Feel free to add more alternatives as Pull Request.* \n\n## License\n\n- `Laravel Nova Ban` package is open-sourced software licensed under the [MIT License](LICENSE) by [Anton Komarev].\n- `Fat Boss In Jail` image licensed under [Creative Commons 3.0](https://creativecommons.org/licenses/by/3.0/us/) by Gan Khoon Lay.\n\n## About CyberCog\n\n[CyberCog] is a Social Unity of enthusiasts. Research best solutions in product \u0026 software development is our passion.\n\n- [Follow us on Twitter](https://twitter.com/cybercog)\n\n\u003ca href=\"https://cybercog.su\"\u003e\u003cimg src=\"https://cloud.githubusercontent.com/assets/1849174/18418932/e9edb390-7860-11e6-8a43-aa3fad524664.png\" alt=\"CyberCog\"\u003e\u003c/a\u003e\n\n[Anton Komarev]: https://komarev.com\n[CyberCog]: https://cybercog.su\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcybercog%2Flaravel-nova-ban","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcybercog%2Flaravel-nova-ban","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcybercog%2Flaravel-nova-ban/lists"}