Skip to content

rodrixcornell/laravel-api-generate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 

Repository files navigation

rodrixcornell/apigenerate

API Rest generator for Laravel Framework. Create your api resource in seconds using only your database table name or connection name.

Installation

  "require-dev": {
    ...
    "rodrixcornell/apigenerate": "dev-master",
    ...
  },
  "repositories": [{
    "type": "vcs",
    "url": "https://github.com/rodrixcornell/laravel-api-generate.git"
  }],
composer update
composer require rodrixcornell/apigenerate --dev

Install the service provider:

// app/Providers/AppServiceProvider.php
public function register()
{
	if ($this->app->environment() !== 'production') {
		$this->app->register(\Rodrixcornell\ApiGenerate\ApiGenerateServiceProvider::class);
	}
}

Usage

Creating a new resource

To create all API Rest resources run this command (Only postgres and mysql):

php artisan api:generate --con=conection_name

To create a new api resource run this command:

php artisan api:generate --table=table_name --relation=true

You can see result in http://localhost:8000/api/table_name You can find your new resource in app/Modules/General. General is the default

Params

To define route:

php artisan api:generate --table=table_name --route=my-custom-route --relation=true

To define module name:

php artisan api:generate --table=table_name --route=my-custom-route --module=Exemple --relation=true

You can find your new resource in app/Modules/Exemple.

Postcardware

You are free to use this package as it's MIT-licensed

About

Easy api generate for the Laravel Framework.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%