Download the PHP package kindharika/laravel-api-starter without Composer

On this page you can find all versions of the php package kindharika/laravel-api-starter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-api-starter

Laravel API Starter

Pure API package for Laravel 11 / 12 / 13 (PHP ^8.3).

Scaffold CRUD + OpenAPI/Swagger, service layer, UUID models, datatable macro. 2.2 adds column-driven generation, modules, RBAC adapter, SSO. Modules (module:*) are the recommended structure for new APIs; the flat api:* surface remains fully supported and unchanged.


Table of contents

  1. Install
  2. Quick start: Modules (module:*)
  3. Columns (--columns)
  4. Flat API (api:*)
  5. Auth / Sanctum
  6. RBAC
  7. SSO
  8. Audit
  9. Swagger
  10. Remove
  11. Config
  12. Security
  13. Versioning

Install

Optional publish:


Quick start: Modules (module:*)

Isolated APIs under app/Modules/{Name}. This is the recommended default. The flat api:scaffold flow stays fully supported as an alternative — see Flat API (api:*).

One name is enough: module:scaffold Course → module and model Course, URL /api/course (not /api/course/courses).

Nested resources still work: module:scaffold Blog Post → /api/blog/posts.

Module routes = one file (Routes/api.php)

When How Result
Public CRUD module:scaffold Blog Post Route::apiResource(...) without auth
Login needed module:scaffold Blog Post --auth or API_STARTER_AUTH=true auth:sanctum middleware inside api.php
+ permission --permission=posts.manage Adds api-starter.permission:… on the same route

Example output of --auth:

Edit one file only. Mix public + protected inside api.php — anything that needs a token goes in Route::middleware(['auth:sanctum'])->group(...).

Legacy Routes/api-protected.php (older modules) is still loaded, with auth applied outside the file. New modules do not create it. You may move its contents into api.php and then delete api-protected.php.

Command Purpose
module:scaffold Recommended default — CRUD inside a module (app/Modules)
api:scaffold Flat alternative — CRUD directly under app/

Columns (--columns)

Generate fillable, migration, validation, resource, and Swagger schemas from one spec. Works with both module:scaffold and api:scaffold.

Shell tip (important)

Quote --columns=…. Unquoted | is a shell pipe and breaks the command.

Spec format

Common types

Group Types
String char, string, text, mediumText, longText
Int integer/int, tinyInteger, smallInteger, mediumInteger, bigInteger + unsigned*
Number float, double, decimal, unsignedDecimal
Bool boolean/bool
Date date, dateTime, dateTimeTz, time, timeTz, timestamp/timestamps, timestampTz/timestampsTz, year
Other json, jsonb, enum, set, binary, uuid, ulid, ipAddress/ip, macAddress/mac
FK foreignId, foreignUuid, foreignUlid
Spatial geometry, point, …

Without --columns: interactive prompt, or default name + description.


Flat API (api:*)

Flat (non-module) CRUD generated straight into app/. Fully supported — use it for existing apps already on this layout, or when a module is more structure than you need. For new APIs prefer module:scaffold.

Artifact Path
Model app/Models/Post.php
Controller app/Http/Controllers/Api/PostController.php
Requests app/Http/Requests/Post/…
Service app/Services/Post/…
Resource app/Http/Resources/PostResource.php
Migration database/migrations/*_create_posts_table.php
Route routes/api-starter/posts.php
OpenAPI storage/api-docs/openapi.json only (single Swagger doc)

Single generators: api:make-model|controller|service|request|migration|resource|route|openapi.


Auth / Sanctum

Flat api:* (two folders — different loaders)

Folder Auth When used
routes/api-starter/ Public Default api:scaffold
routes/api-starter-protected/ auth:sanctum --auth or API_STARTER_AUTH=true (new scaffolds only)

The flat surface keeps two folders because the loader attaches middleware outside the file. Modules already use one file with middleware inside.

Setup Sanctum

Method Path Auth
POST /api/auth/register public
POST /api/auth/login public
POST /api/auth/forgot-password public
POST /api/auth/reset-password public
POST /api/auth/logout Bearer
GET /api/auth/me Bearer

Swagger Authorize: paste token only (no Bearer prefix).

Security: a route without auth:sanctum can be hit by anyone. Never put sensitive data on a public route.


RBAC

Opt-in. No forced package.

Custom: API_STARTER_RBAC_CHECKER → class implementing RbacCheckerInterface. When rbac.enabled=false, permission/role middleware = no-op.


SSO

Method Path
POST /api/auth/sso/{provider} (access_token or Google id_token)
GET /api/auth/sso/{provider}/redirect
GET /api/auth/sso/{provider}/callback

Audit

Drivers: database | spatie | null. Trait: Kindharika\ApiStarter\Audit\Auditable.


Swagger

One file: storage/api-docs/openapi.json

Scaffold / auth / SSO / module output all merge into that one file — no *.openapi.json fragments are written.

Schemas follow --columns. Success responses document the full envelope — code, success, message, data, plus meta on paginated lists — for module and flat resources alike, matching Kindharika\ApiStarter\Base\ResponseService.

Generated controllers carry no @OA annotations. openapi.json is the single source of truth and is built purely by merging JSON fragments — the package never parses annotations. Host apps that want darkaonline/l5-swagger to scan their controllers can publish the stubs (php artisan vendor:publish --tag=api-starter-stubs) and add annotations there; the {{openApiResourceProperties}}, {{openApiRequestProperties}} and {{openApiStoreRequired}} replacements are still supplied to custom stubs.

Hard refresh Swagger UI after a prune (browser cache).


Remove

api:remove removes a flat scaffolded resource — files under app/, routes in routes/api-starter*, and its OpenAPI entries. It is not module:remove and never touches app/Modules. module:remove removes a module resource, or an entire module.

Deletes model, controller, service, requests, resource, routes, OpenAPI (paths + tags + schemas). Migrations deleted unless --keep-migration. If already migrated → migrate:rollback manually.


Config

Publish config/api-starter.php. Highlights:

Key Notes
uuid_version 7 (default), 4, or 1
modules.path app/Modules
auth.enabled New scaffolds default to protected routes
rbac.driver spatie | gate | custom | null
openapi.enabled Swagger UI + JSON
datatable.per_page Default page size

Typed filter DTO: Kindharika\ApiStarter\Support\DatatableFilter::fromRequest($request).


Security


Versioning

Package PHP Laravel
2.2.x ^8.3 11 / 12 / 13
2.1.x ^8.3 11 / 12 / 13
1.x ^8.2 11 / 12

See CHANGELOG.md.

License

MIT


All versions of laravel-api-starter with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/console Version ^11.0 || ^12.0 || ^13.0
illuminate/database Version ^11.0 || ^12.0 || ^13.0
illuminate/http Version ^11.0 || ^12.0 || ^13.0
illuminate/routing Version ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^11.0 || ^12.0 || ^13.0
ramsey/uuid Version ^4.7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kindharika/laravel-api-starter contains the following files

Loading the files please wait ...