API Generator
Last updated
Last updated
For every CRUD, by default, QuickAdminPanel 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 generate the API functionality (see above).
If checked, there's a separate Controller created in app/Http/Controllers/Api/V1/Admin folder.
Also it's added to routes/api.php file, like this:
You can turn this function on/off for every CRUD separately.
GET /api/v1/users - get the list of users
POST /api/v1/users - create new user
GET /api/v1/users/1 - get the user with users.id = 1
PUT /api/v1/users/1 - update the user with users.id = 1
DELETE /api/v1/users/1 - delete the user with users.id = 1
Default URL endpoints for all CRUDs are /api/v1/[crud_name]. We generate all API Resourceful Controller methods, so these URLs apply - :
Detailed visual example is in this blog article:
We also generate with their default functionality. See, for example, app/Http/Resources/Admin/UserResource.php:
Notice: our tool is generating API routes that are protected by middleware auth:sanctum that comes from .
More information in this article:
Separate question from the customers was about uploading files to the API. For that, we have a separate article on our blog, which can be applied with or without QuickAdminPanel:
QuickAdminPanel doesn't generate API docs by default, but here's another article on our blog about the tool that we recommend: