Laravel API Generator: Generate a REST API from a Laravel model

Recommend this page to a friend!
  Info   View files Documentation   View files View files (23)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2020-07-15 (26 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 26 This week: 1All time: 9,971 This week: 260Up
Version License PHP version Categories
laravel-api-generato 1.0.0Custom (specified...5PHP 5, Libraries, Web services, Code ...
Description Author

This package can be used to generate a REST API from a Laravel model.

It takes the name of given model and generates files to implement a Web services API for handling calls to the model class.

Currently the package can generate controller, resource, collection and route classes.

Picture of Bhavin Gajjar
Name: Bhavin Gajjar <contact>
Classes: 1 package by
Country: United States United States
Age: ???
All time rank: 4357504 in United States United States
Week rank: 270 Up28 in United States United States Up

Details

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 bhavingajjar/laravel-api-generator

Publish Configuration File

php artisan vendor:publish --provider="Bhavingajjar\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

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email gajjarbhavin22@gmail.com instead of using the issue tracker.

Credits

License

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

  Files folder image Files  
File Role Description
Files folder image.github (1 directory)
Files folder imageconfig (1 file)
Files folder imagesrc (3 files, 3 directories)
Files folder imagetests (1 file)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .scrutinizer.yml Data Auxiliary data
Accessible without login Plain text file .styleci.yml Data Auxiliary data
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file CONTRIBUTING.md Data Auxiliary data
Accessible without login HTML file index.html Doc. Documentation
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file _config.yml Data Auxiliary data

  Files folder image Files  /  .github  
File Role Description
Files folder imageworkflows (1 file)

  Files folder image Files  /  .github  /  workflows  
File Role Description
  Accessible without login Plain text file laravel.yml Data Auxiliary data

  Files folder image Files  /  config  
File Role Description
  Accessible without login Plain text file config.php Aux. Auxiliary script

  Files folder image Files  /  src  
File Role Description
Files folder imageCommands (1 file)
Files folder imageMiddleware (1 file)
Files folder imageresources (1 directory)
  Plain text file LaravelApiGenerator.php Class Class source
  Plain text file LaravelApiGeneratorFacade.php Class Class source
  Plain text file LaravelApiGeneratorServiceProvider.php Class Class source

  Files folder image Files  /  src  /  Commands  
File Role Description
  Plain text file GenerateApi.php Class Class source

  Files folder image Files  /  src  /  Middleware  
File Role Description
  Plain text file ApiHeaderInject.php Class Class source

  Files folder image Files  /  src  /  resources  
File Role Description
Files folder imagestubs (3 files)

  Files folder image Files  /  src  /  resources  /  stubs  
File Role Description
  Plain text file collection.stub Class Class source
  Plain text file controller.stub Class Class source
  Plain text file resource.stub Class Class source

  Files folder image Files  /  tests  
File Role Description
  Plain text file ExampleTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:26
This week:1
All time:9,971
This week:260Up

For more information send a message to info at phpclasses dot org.