Looking to hire Laravel developers? Try LaraJobs

laravel-api-generator maintained by giangmv

Description
a laravel rest api generator with API Resources
Last update
2022/05/09 10:50 (dev-main)
License
Downloads
35

Comments
comments powered by Disqus

Laravel API Generator With Resources

Latest Version on Packagist Build Status Quality Score Total Downloads StyleCI

This package is used to generate laravel api with Resources

Installation

You can install the package via composer:

composer require Giangmv/laravel-api-generator

Publish Configuration File

php artisan vendor:publish --provider="Giangmv\LaravelApiGenerator\Providers\RepositoryServiceProvider" --tag="repository-config"

php artisan vendor:publish --provider="Giangmv\LaravelApiGenerator\LaravelApiGeneratorServiceProvider" --tag="config"

Next, if you plan for cross origin support, you should add middleware to your api middleware group within your app/Http/Kernel.php file:
'ApiHeaderInject'

add in env
for allow cross origin support
API_ALLOW_CROSS_ORIGIN = true
for json content type
API_JSON_RESPONSE = true

Usage

php artisan api:generate --model=User --module=Users

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

Credits

License

The MIT License (MIT). Please see License File for more information.