Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akiyamasm/nova-resource-maker
A Nova tool that will help you to generate fields array for the resource.
https://github.com/akiyamasm/nova-resource-maker
Last synced: 8 days ago
JSON representation
A Nova tool that will help you to generate fields array for the resource.
- Host: GitHub
- URL: https://github.com/akiyamasm/nova-resource-maker
- Owner: akiyamaSM
- Created: 2018-08-22T22:09:27.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-26T08:53:47.000Z (over 5 years ago)
- Last Synced: 2024-10-31T01:48:42.263Z (21 days ago)
- Language: PHP
- Homepage:
- Size: 32.2 KB
- Stars: 25
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nova-resource-maker
[![License](https://poser.pugx.org/inani/nova-resource-maker/license)](https://packagist.org/packages/inani/nova-resource-maker)
[![Total Downloads](https://poser.pugx.org/inani/nova-resource-maker/downloads)](https://packagist.org/packages/inani/nova-resource-maker)
![CI status](https://img.shields.io/badge/build-passing-brightgreen.svg)
[![Latest Stable Version](https://poser.pugx.org/inani/nova-resource-maker/v/stable)](https://packagist.org/packages/inani/nova-resource-maker)A Nova tool that will help you to generate fields array for the resource.
You can check this [medium post](https://medium.com/@InaniT0/generate-your-resource-fields-with-no-pain-108d7369489e) on how to use it## Installation
### Requirements
* Laravel NovaFirst, install the package through [Composer](https://getcomposer.org/).
```bash
composer require inani/nova-resource-maker
```
## Usage
Run the commande line```bash
php artisan nova-resource-fields:generate
```
> if your model within `app` folder, you can just set Model Name only without full namespaceAnd 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
```php
/**
* 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](https://choosealicense.com/licenses/mit/)