laravel-kodyfire v0.1.34
Laravel-kodyfire
Generate Laravel models, migrations and more using Kodyfire.
Homepage
Requirements
laravel-kodyfire requires the kodyfire-cli to be installed
npm install -g kodyfire-cliInstall
npm i laravel-kodyfireUsage
Method 1: As a generator
In order to generate your artifacts, run the generate command. The syntax is kody generate|g [kody] [concept]. If you ommit kody and concept the assistant will prompt you to select them. As an example, run the following command from your terminal:
kody generate laravel modelor you can you the shorthand generation command
kody g laravel:model YourModelNameThe shorthand will execute without prompting if no additional arguments are required
You can also create related artifacts by providing the --includes option with a list of comma seperated artifacts
kody g laravel:model YourModelName --includes migration,seeder,factoryIn order to list available concepts, run the following command:
kody ls laravelTo list available templates run:
kody ls laravel -s templatesTo use a different template run
kody g laravel:model YourModelName --overwrites template:templateNameWhen providing a template name ommit the prefix and extension part of the template name. For example if the template name is controller.api.php.template, You should overwrite the template as follow:
kody g laravel:controller YourControllerlName --overwrites template:api--overwrites are the concept arguments. In order to list available arguments of all concepts run the following command:
kody ls laravel -s overwritesMethod 2: As an importer
You can use a source containing the definition of the artifacts you want to create at once. Available sources: yaml, plantuml(class diagram). As an example, A declaration for the yaml laravel source import file might look like the following
models:
user:
fields:
name: string
email: string nullable unique
status: enum:active,inactive default:active
password,phone,role: string nullable
email_verified_at: timestamp nullable
hidden: password
relations:
belongsTo: Company
...After adding your definitions, run the following command to import your assets.
kody import laravel migration,model -s import.yamlUsing your own templates
Since every project has its specificity, you can always overwrite the default templates provided by the package.
In order to start using your own templates, you must publish the default templates into your root project under .kody/laravel-kodyfire.
To do so run
kody publish laravelor
kody publish laravel templateNameif you want to overwrite a single template
After updating the published template content. Test drive your template by running
kody g model yourModelNameAvailable concepts TODO
concept (default)
Generates a generic concept
modelGenerates a model class
controllerGenerates a controller class
requestGenerates a request class
resourceGenerates a resource class
collectionGenerates a collection class
eventGenerates an event class
listenerGenerates a listener class
subscriberGenerates a subscriber class
observerGenerates a observer class
policyGenerates a policy class
factoryGenerates a factory class
seederGenerates a seeder class
testGenerates a test class
testUnitGenerates a unit test class
middlewareGenerates a middleware class
repositoryGenerates a repository class
Usage
kody g laravel yourConceptArguments
kodystring - The name of the kody. Laravel in our case. You can also use thekody:conceptsyntax. You can have multiple kodies installed. To list your installed kodies within your project runkody listconceptstring - The name of the concept you want to execute. if you've used the kody:concept syntax this argument will be considered thenameargument and the command will not prompt you for additional arguments if there is no other required parameters. To list the concepts of your installed kody (laravel), runkody list laravelnamestring - The name that will be used to generate your artifact.
Options
-i,--include <includes>Comma separated list of concepts to include. (e.g. -i concept1,concept2). To list available concepts use the list command (e.g. kody list kodyname)-o,--overwrites <overwrites>Overwrite some default schema like the template name you want to use-m,--multipleGenerate multiple artifacts-p,--persistPersist the generated artifact-h, --helpDisplay help for command
📅 Future Features
Incorporate Laravel default stubs as base templatesGenerate migration: allow adding fields and relationsImport and generate models from a plantuml class diagram
Author
Anis Marrouchi
- Website: https://noqta.tn
- Twitter: @anis_marrouchi
- GitHub: @anis-marrouchi
- LinkedIn: @marrouchi
🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Show your support
Give a ⭐️ if this project helped you!
Credits
📝 License
Copyright © 2022 Anis Marrouchi.
This project is MIT licensed.
This README was generated with ❤️ by readme-kodyfire
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago