Skip to content

A Nova tool that will help you to generate fields array for the resource.

Notifications You must be signed in to change notification settings

akiyamaSM/nova-resource-maker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 

Repository files navigation

nova-resource-maker

License Total Downloads CI status Latest Stable Version

A Nova tool that will help you to generate fields array for the resource.
You can check this medium post on how to use it

Installation

Requirements

  • Laravel Nova

First, install the package through Composer.

composer require inani/nova-resource-maker

Usage

Run the commande line

php artisan nova-resource-fields:generate

if your model within app folder, you can just set Model Name only without full namespace

And then just answer to the questions and copy the result.

Relationships

Now its possible to generate the relationships, all you have to do is to add the name of the relationship class in the Doc comment of the method

/**
 * Get the posts
 *
 * @relation('HasMany')
 * @return \Illuminate\Database\Eloquent\Relations\HasMany
 */
public function posts()
{
    return $this->hasMany(Post::class);
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

About

A Nova tool that will help you to generate fields array for the resource.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages