{"id":15296457,"url":"https://github.com/saeeddev94/laravel-annotation","last_synced_at":"2025-05-07T03:21:25.330Z","repository":{"id":43074824,"uuid":"446939158","full_name":"SaeedDev94/laravel-annotation","owner":"SaeedDev94","description":"Laravel #[Annotation]","archived":false,"fork":false,"pushed_at":"2024-04-22T11:56:34.000Z","size":52,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T08:58:22.742Z","etag":null,"topics":["annotation","attribute","laravel","laravel-9","php8"],"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/SaeedDev94.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2022-01-11T18:36:18.000Z","updated_at":"2024-04-22T11:56:06.000Z","dependencies_parsed_at":"2023-02-10T19:35:11.328Z","dependency_job_id":"3f03d2c7-9405-4306-b4e8-25de102f340d","html_url":"https://github.com/SaeedDev94/laravel-annotation","commit_stats":{"total_commits":46,"total_committers":3,"mean_commits":"15.333333333333334","dds":"0.10869565217391308","last_synced_commit":"7deb609a3801e9858e5272cf872067f41aa3fc7b"},"previous_names":["saeeddev94/laravel-annotation","saeed-pooyanfar/laravel-annotation"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaeedDev94%2Flaravel-annotation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaeedDev94%2Flaravel-annotation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaeedDev94%2Flaravel-annotation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SaeedDev94%2Flaravel-annotation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SaeedDev94","download_url":"https://codeload.github.com/SaeedDev94/laravel-annotation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252804787,"owners_count":21806877,"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":["annotation","attribute","laravel","laravel-9","php8"],"created_at":"2024-09-30T18:10:34.204Z","updated_at":"2025-05-07T03:21:25.313Z","avatar_url":"https://github.com/SaeedDev94.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel #[Annotation]\n\n### Introduction\n\nPHP 8.0 release was a revolution for the language.  \nIt brings cool features like [`Named arguments`](https://www.php.net/releases/8.0/en.php#named-arguments), [`Attributes`](https://www.php.net/releases/8.0/en.php#attributes), [`Constructor property`](https://www.php.net/releases/8.0/en.php#constructor-property-promotion) and ...  \nPHP 8.1 brings even more exciting features like [`Enumerations`](https://www.php.net/releases/8.1/en.php#enumerations), [`New in initializers`](https://www.php.net/releases/8.1/en.php#new_in_initializers), [`Array unpacking`](https://www.php.net/releases/8.1/en.php#array_unpacking_support_for_string_keyed_arrays) and ...  \n**The idea of this package is using PHP [`Attribute`](https://www.php.net/manual/en/language.attributes.overview.php) in a laravel project.**\n\n### Installing\n\n```bash\ncomposer require saeedpooyanfar/laravel-annotation\n```\n\n### Setup\n\nIn `App\\Http\\Controllers\\Controller::class` :  \nReplace `use Illuminate\\Routing\\Controller as BaseController;`  \nWith `use LaravelAnnotation\\BaseController;`\n  \nOr if you don't want to change your BaseController you can:  \n  \nUse `LaravelAnnotation\\AttributeMiddleware` trait  \nIn `App\\Http\\Controllers\\Controller::class`\n\n### Middleware attribute\n\nHere is an example that how you can use `Middleware` attribute in a laravel controller:\n\n```php\n\u003c?php\n\nuse LaravelAnnotation\\Attribute\\Middleware;\n\n#[Middleware(RedirectIfAuthenticated::class, 'sanctum', except: 'logout')]\nclass AuthController extends Controller\n{\n    public function register()\n    {\n    }\n    \n    public function login()\n    {\n    }\n    \n    #[Middleware(Authenticate::class, 'sanctum')]\n    public function logout()\n    {\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaeeddev94%2Flaravel-annotation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaeeddev94%2Flaravel-annotation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaeeddev94%2Flaravel-annotation/lists"}