{"id":23489960,"url":"https://github.com/opheus2/laravel-makeclass","last_synced_at":"2025-04-15T04:31:05.364Z","repository":{"id":57032425,"uuid":"446161312","full_name":"opheus2/laravel-makeclass","owner":"opheus2","description":"A simple php class creator for laravel.","archived":false,"fork":false,"pushed_at":"2022-01-10T15:09:51.000Z","size":11,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T06:07:23.654Z","etag":null,"topics":["laravel","laravel-package","php","php-class","php-classes"],"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/opheus2.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-09T17:47:30.000Z","updated_at":"2022-11-10T10:20:20.000Z","dependencies_parsed_at":"2022-08-24T00:01:04.198Z","dependency_job_id":null,"html_url":"https://github.com/opheus2/laravel-makeclass","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opheus2%2Flaravel-makeclass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opheus2%2Flaravel-makeclass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opheus2%2Flaravel-makeclass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opheus2%2Flaravel-makeclass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opheus2","download_url":"https://codeload.github.com/opheus2/laravel-makeclass/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249006376,"owners_count":21197262,"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":["laravel","laravel-package","php","php-class","php-classes"],"created_at":"2024-12-25T00:12:56.364Z","updated_at":"2025-04-15T04:31:05.340Z","avatar_url":"https://github.com/opheus2.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Make Class\n### Features\n\n- Create a php class from the command for any directory in the root name-space;\n- Store a custom path as an alias and use alias instead of full path.\n- Create interface | class | enum | trait.\n- Create final and abstract classes\n- Create class with a declare strict_type\n\n### Installation\n```bash\ncomposer require opheus2/laravel-makeclass\n```\n\n###Usages\n\u003e File is created in root name-space. E.b App\n```bash\nphp artisan make:class {name}\n```\nDefault type is class.\n\n------------\n\n\u003e File is created in test folder in root name-space. E.b App/Test\n```bash\nphp artisan make:class Test\\{name}\n```\n------------ \n\u003e Create an interface type of class\n```bash\nphp artisan make:class {name} -i\n\t\t\t\t\tor\nphp artisan make:class {name} --type interface\n```\n------------ \n\n| Available types | flags           |\n| ------------| :-------------:\n| class     | (default no flag)     |\n| interface | (-i or --interface)   |\n| trait     | (-T or --trait)       |\n| enum      | (-e or --enum)        |\n\n\n------------\n\u003e Using custom path with alias\n```bash\nphp artisan make:class {name} -i -p=\"Domains/Services/\" --alias=\"ape\"\n\t\t\t\t\tor\nphp artisan make:class {name} -i -p=Domain\\Services\\ --alias=ape\n\t\t\t\t\tor\nphp artisan make:class {name} -i -p Domain\\Services\\ --alias ape\n```\n**Please note:** You always need to add a trailing slash at the end for it to work properly.\nI would surely fix that soon. \n\nThen you can use alias as path\n```bash\nphp artisan make:class {name} -i -p=\"ape\"\n```\nThis would use the same old/saved path for subsequent file names\n\n------------\n\u003e Using modifiers\n```bash\nphp artisan make:class {name} -fx\n```\nThis would create a final class with declare strict_types at the top\nYou can use the -x flag to always add the strict type to any class type\n\n------------\n\n|  Available modifiers | flags |\n| ------------ | :-------------:|\n|  strict | (-x or --strict) |\n|   final | (-f or --final) |\n|   abstract | (-a or --abstract) |\n\nFor more info you can do \n```bash\nphp artisan make:class --help\n```\n\n####Thank you\n\n###TODO\n- [ ] Add check for trailing slash and auto fix\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopheus2%2Flaravel-makeclass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopheus2%2Flaravel-makeclass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopheus2%2Flaravel-makeclass/lists"}