PHP Classes

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

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 43 All time: 10,838 This week: 455Up
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: 4503567 in United States United States
Week rank: 216 Up24 in United States United States Up

Documentation

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 (23)  
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 (23)  /  .github  
File Role Description
Files folder imageworkflows (1 file)

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

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

  Files folder image Files (23)  /  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 (23)  /  src  /  Commands  
File Role Description
  Plain text file GenerateApi.php Class Class source

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

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

  Files folder image Files (23)  /  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 (23)  /  tests  
File Role Description
  Plain text file ExampleTest.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:43
This week:0
All time:10,838
This week:455Up