npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

laravel-kodyfire

v0.1.34

Published

A code generation tool for Laravel developers to rapidly generate artifacts using kodyfire

Downloads

27

Readme

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