0.1.34 • Published 11 months ago

laravel-kodyfire v0.1.34

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

Laravel-kodyfire

Version Documentation License: MIT

Generate Laravel models, migrations and more using Kodyfire.

Homepage

Requirements

laravel-kodyfire requires the kodyfire-cli to be installed

npm install -g kodyfire-cli

Install

npm i laravel-kodyfire

Usage

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 model

or you can you the shorthand generation command

kody g laravel:model YourModelName

The 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,factory

In order to list available concepts, run the following command:

kody ls laravel

To list available templates run:

kody ls laravel -s templates

To use a different template run

kody g laravel:model YourModelName --overwrites template:templateName

When 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 overwrites

Method 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.yaml

Using 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 laravel

or

kody publish laravel templateName

if you want to overwrite a single template

After updating the published template content. Test drive your template by running

kody g model yourModelName

Available concepts TODO

concept (default)

Generates a generic concept

model

Generates a model class

controller

Generates a controller class

request

Generates a request class

resource

Generates a resource class

collection

Generates a collection class

event

Generates an event class

listener

Generates a listener class

subscriber

Generates a subscriber class

observer

Generates a observer class

policy

Generates a policy class

factory

Generates a factory class

seeder

Generates a seeder class

test

Generates a test class

testUnit

Generates a unit test class

middleware

Generates a middleware class

repository

Generates a repository class

Usage
kody g laravel yourConcept
Arguments
  • kody string - The name of the kody. Laravel in our case. You can also use the kody:concept syntax. You can have multiple kodies installed. To list your installed kodies within your project run kody list
  • concept string - The name of the concept you want to execute. if you've used the kody:concept syntax this argument will be considered the name argument 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), run kody list laravel
  • name string - 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,--multiple Generate multiple artifacts
  • -p,--persist Persist the generated artifact
  • -h, --help Display help for command

📅 Future Features

  • Incorporate Laravel default stubs as base templates
  • Generate migration: allow adding fields and relations
  • Import and generate models from a plantuml class diagram

Author

Anis 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

0.1.32

12 months ago

0.1.33

12 months ago

0.1.34

11 months ago

0.1.30

1 year ago

0.1.31

1 year ago

0.1.27

1 year ago

0.1.28

1 year ago

0.1.29

1 year ago

0.1.22

1 year ago

0.1.23

1 year ago

0.1.24

1 year ago

0.1.25

1 year ago

0.1.16

1 year ago

0.1.17

1 year ago

0.1.18

1 year ago

0.1.19

1 year ago

0.1.13

1 year ago

0.1.14

1 year ago

0.1.15

1 year ago

0.0.169

1 year ago

0.0.168

1 year ago

0.0.167

1 year ago

0.0.172

1 year ago

0.0.171

1 year ago

0.0.170

1 year ago

0.1.10

1 year ago

0.1.11

1 year ago

0.1.12

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.9

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.0.84

2 years ago

0.0.85

2 years ago

0.0.159

2 years ago

0.0.86

2 years ago

0.0.158

2 years ago

0.0.87

2 years ago

0.0.88

2 years ago

0.0.89

2 years ago

0.0.153

2 years ago

0.0.151

2 years ago

0.0.150

2 years ago

0.0.157

2 years ago

0.0.80

2 years ago

0.0.156

2 years ago

0.0.81

2 years ago

0.0.155

2 years ago

0.0.82

2 years ago

0.0.154

2 years ago

0.0.83

2 years ago

0.0.78

2 years ago

0.0.79

2 years ago

0.0.164

2 years ago

0.0.162

2 years ago

0.0.161

2 years ago

0.0.166

2 years ago

0.0.165

2 years ago

0.0.160

2 years ago

0.0.106

2 years ago

0.0.105

2 years ago

0.0.104

2 years ago

0.0.103

2 years ago

0.0.109

2 years ago

0.0.108

2 years ago

0.0.107

2 years ago

0.0.102

2 years ago

0.0.101

2 years ago

0.0.100

2 years ago

0.0.117

2 years ago

0.0.116

2 years ago

0.0.115

2 years ago

0.0.114

2 years ago

0.0.119

2 years ago

0.0.118

2 years ago

0.0.113

2 years ago

0.0.112

2 years ago

0.0.111

2 years ago

0.0.110

2 years ago

0.0.128

2 years ago

0.0.127

2 years ago

0.0.126

2 years ago

0.0.125

2 years ago

0.0.129

2 years ago

0.0.120

2 years ago

0.0.124

2 years ago

0.0.123

2 years ago

0.0.122

2 years ago

0.0.121

2 years ago

0.0.139

2 years ago

0.0.138

2 years ago

0.0.137

2 years ago

0.0.136

2 years ago

0.0.130

2 years ago

0.0.135

2 years ago

0.0.132

2 years ago

0.0.95

2 years ago

0.0.96

2 years ago

0.0.148

2 years ago

0.0.97

2 years ago

0.0.98

2 years ago

0.0.99

2 years ago

0.0.141

2 years ago

0.0.140

2 years ago

0.0.90

2 years ago

0.0.91

2 years ago

0.0.145

2 years ago

0.0.92

2 years ago

0.0.144

2 years ago

0.0.143

2 years ago

0.0.94

2 years ago

0.0.73

2 years ago

0.0.74

2 years ago

0.0.75

2 years ago

0.0.76

2 years ago

0.0.77

2 years ago

0.0.71

2 years ago

0.0.72

2 years ago

0.0.69

2 years ago

0.0.68

2 years ago

0.0.67

2 years ago

0.0.66

2 years ago

0.0.65

2 years ago

0.0.64

2 years ago

0.0.63

2 years ago

0.0.62

2 years ago

0.0.61

2 years ago

0.0.60

2 years ago

0.0.59

2 years ago

0.0.56

2 years ago

0.0.53

2 years ago

0.0.27

2 years ago