<style>.woocommerce-product-gallery{ opacity: 1 !important; }</style>

MODULES

API Generator


What does it do?

It creates API Routes and Controllers for your CRUD menu item, so you can use it from your mobile app or front-end.

Whenever you create or edit a CRUD, there's a checkbox whether to create API controller (see above).

If checked, there's a separate Controller created in app/Http/Controllers/Api/V1 folder.

namespace App\Http\Controllers\Api\V1;

use App\Project;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Requests\Admin\StoreProjectsRequest;
use App\Http\Requests\Admin\UpdateProjectsRequest;

class ProjectsController extends Controller
{
    public function index()
    {
        return Project::all();
    }

    public function show($id)
    {
        return Project::findOrFail($id);
    }

    public function update(UpdateProjectsRequest $request, $id)
    {
        $project = Project::findOrFail($id);
        $project->update($request->all());

        return $project;
    }

    public function store(StoreProjectsRequest $request)
    {
        $project = Project::create($request->all());

        return $project;
    }

    public function destroy($id)
    {
        $project = Project::findOrFail($id);
        $project->delete();
        return '';
    }
}
Also it's added to routes/api.php file, like this:
Route::group(['prefix' => '/v1', 'namespace' => 'Api\V1', 'as' => 'api.'], function () {

        Route::resource('projects', 'ProjectsController', ['except' => ['create', 'edit']]);

});
You can turn this function on/off for every controller separately.

Notice: our tool is generating API routes but they are not protected by any Auth mechanism, you need to take care of this yourself after download. The most popular way is using Laravel Passport.

This function is available in all membership plans, including free trial.

More information