{"id":19870295,"url":"https://github.com/alphaolomi/laravel-approvals","last_synced_at":"2025-05-02T08:31:44.161Z","repository":{"id":181505251,"uuid":"666874530","full_name":"alphaolomi/laravel-approvals","owner":"alphaolomi","description":"Laravel Approvals is a package that allows you to approve Eloquent models.","archived":false,"fork":false,"pushed_at":"2024-04-29T13:54:32.000Z","size":40,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-21T05:14:16.995Z","etag":null,"topics":["approval-process","laravel","workflow"],"latest_commit_sha":null,"homepage":"https://alphaolomi.github.io/laravel-approvals/","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/alphaolomi.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-15T21:55:46.000Z","updated_at":"2024-08-26T04:49:11.780Z","dependencies_parsed_at":"2024-08-26T04:59:12.527Z","dependency_job_id":null,"html_url":"https://github.com/alphaolomi/laravel-approvals","commit_stats":null,"previous_names":["alphaolomi/laravel-approvals"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphaolomi%2Flaravel-approvals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphaolomi%2Flaravel-approvals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphaolomi%2Flaravel-approvals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphaolomi%2Flaravel-approvals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alphaolomi","download_url":"https://codeload.github.com/alphaolomi/laravel-approvals/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252008845,"owners_count":21679648,"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","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":["approval-process","laravel","workflow"],"created_at":"2024-11-12T16:08:32.570Z","updated_at":"2025-05-02T08:31:43.895Z","avatar_url":"https://github.com/alphaolomi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Approvals\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/alphaolomi/laravel-approvals.svg?style=flat-square)](https://packagist.org/packages/alphaolomi/laravel-approvals)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/alphaolomi/laravel-approvals/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/alphaolomi/laravel-approvals/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/alphaolomi/laravel-approvals/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\u0026style=flat-square)](https://github.com/alphaolomi/laravel-approvals/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/alphaolomi/laravel-approvals.svg?style=flat-square)](https://packagist.org/packages/alphaolomi/laravel-approvals)\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require alphaolomi/laravel-approvals\n```\n\nYou can publish and run the migrations with:\n\n```bash\nphp artisan vendor:publish --tag=\"laravel-approvals-migrations\"\nphp artisan migrate\n```\n\nYou can publish the config file with:\n\n```bash\nphp artisan vendor:publish --tag=\"laravel-approvals-config\"\n```\n\n\n## Usage\n\n```php\n$project = Project::find(1);\n\n// Approve a project\n$project-\u003eapprove('project-submitted', auth()-\u003euser());\n\n// Check if a project is approved\n$project-\u003eisApproved('project-submitted'); // true\n$project-\u003eisApproved('project-submitted', auth()-\u003euser()); // true\n\n// Check if a project is approved by a specific user\n$project-\u003eisApproved('project-submitted', User::find(2)); // false\n\n$admin = User::find(2);\n\n// Now approve the project by an admin\n$project-\u003eapprove('project-approved', $admin);\n\n// Check if a project is approved\n$project-\u003eisApproved('project-approved'); // true\n```\n\nUsing the facade\n\n```php\nuse Alphaolomi\\LaravelApprovals\\Facades\\Approvals;\n\n$project = Project::find(1);\n\n// Approve a project\nApprovals::approve($project, 'project-submitted', auth()-\u003euser());\n\n// Get all approvals for a project\n$allProjectApprovals = Approvals::all($project);\n\n// Get all approvals \n$allApprovals = Approvals::allApprovals();\n```\n\n## Testing\n\nProject is tested with [pest](https://pestphp.com/).\n\n```bash\ncomposer test\n```\n\n## Versioning\n\nProject follows [RomVer](https://github.com/romversioning/romver) for versioning. For the versions available, see the [tags on this repository](../../tags).\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- [Alpha Olomi](https://github.com/alphaolomi)\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%2Falphaolomi%2Flaravel-approvals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falphaolomi%2Flaravel-approvals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphaolomi%2Flaravel-approvals/lists"}