{"id":37006725,"url":"https://github.com/therealedatta/laravel-actions","last_synced_at":"2026-01-14T00:45:57.393Z","repository":{"id":60911448,"uuid":"546652169","full_name":"therealedatta/laravel-actions","owner":"therealedatta","description":"Actions: controller + auth + validation in one class","archived":false,"fork":false,"pushed_at":"2023-10-09T02:52:17.000Z","size":53,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-20T09:46:22.410Z","etag":null,"topics":["actions","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/therealedatta.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-10-06T12:30:03.000Z","updated_at":"2024-01-12T18:40:30.000Z","dependencies_parsed_at":"2023-02-16T03:01:20.324Z","dependency_job_id":null,"html_url":"https://github.com/therealedatta/laravel-actions","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":"spatie/package-skeleton-laravel","purl":"pkg:github/therealedatta/laravel-actions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therealedatta%2Flaravel-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therealedatta%2Flaravel-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therealedatta%2Flaravel-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therealedatta%2Flaravel-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/therealedatta","download_url":"https://codeload.github.com/therealedatta/laravel-actions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therealedatta%2Flaravel-actions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406537,"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":["actions","laravel"],"created_at":"2026-01-14T00:45:56.803Z","updated_at":"2026-01-14T00:45:57.386Z","avatar_url":"https://github.com/therealedatta.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Actions: controller + auth + validation in one class\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/therealedatta/laravel-actions.svg?style=flat-square)](https://packagist.org/packages/therealedatta/laravel-actions)\n[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/therealedatta/laravel-actions/run-tests?label=tests)](https://github.com/therealedatta/laravel-actions/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/therealedatta/laravel-actions/Fix%20PHP%20code%20style%20issues?label=code%20style)](https://github.com/therealedatta/laravel-actions/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/therealedatta/laravel-actions.svg?style=flat-square)](https://packagist.org/packages/therealedatta/laravel-actions)\n\nThis package provides only one class: an Action class that extends the FormRequest class we all know and adapt it slightly so it works as an invokable Controller.\n\n## Installation\n\n```bash\ncomposer require therealedatta/laravel-actions\nphp artisan actions:install\n```\n\nYou can publish the action stubs for the make:action commad:\n\n```bash\nphp artisan actions:stubs\n```\n\n## Usage\n\n```bash\nphp artisan make:action User\\EditUser\n```\n\nThis command will create the `User\\Actions\\EditUser` class. The actions subfolder can be modified/removed in in the `config/actions.php` file.\nThe stub used to generate the class can be modified publishing the stub (check installation section).\n\n`handle` should execute the action itself and `__invoke` (or any other method you want to call)\nshould call handle and return the controller response.\n\nThis package executes authorization automatically. By default is true, you can change this in the `config/actions.php` file.\n\nImportant: This package does not call validate automatically. You should call `validate` in `handle` method.\n\n```php\npublic function handle(): User\n{\n    $validated_data = $this-\u003evalidate();\n\n    return tap($this-\u003euser)-\u003eupdate($validated_data);\n}\n```\n\n## Testing\n\nWe use pint for styling, larastan for static analysis and pest for 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- Authors:\n    - [edatta](https://github.com/therealedatta)\n    - [All Contributors](../../contributors)\n\n- Inspiration:\n    - [Loris Leiva actions package](https://github.com/lorisleiva/laravel-actions) / [Loris Leiva request/controller article](https://lorisleiva.com/if-formrequests-and-invokable-controllers-had-a-baby/)\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%2Ftherealedatta%2Flaravel-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftherealedatta%2Flaravel-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftherealedatta%2Flaravel-actions/lists"}