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

On this page you can find all versions of the php package dwivedianuj9118/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

README.md

Laravel API Starter ๐Ÿš€

A production-ready API starter package for Laravel 11+ designed to help you bootstrap APIs instantly without reinventing the wheel. This package is opinionated but highly configurable, tailored for real-world backend applications.

โœจ Features


๐Ÿ“ฅ Installation

Install the package via Composer:

Configuration

Publish the configuration file to customize the behavior:

Environment Variables (.env)

Add or modify these variables to control your API behavior:

JWT Guard

You must define a JWT guard in config/auth.php.

Ensure provider exists


๐Ÿงฏ Global API Exception Handling

The package automatically ensures JSON-only API exception responses.

If you want to customize exception rendering further, you may optionally integrate ApiExceptionHandler into your global exception flow.

๐Ÿ“„ bootstrap/app.php (Laravel 11+)

This ensures: No HTML error pages Consistent API error responses Validation & auth errors normalized

๐Ÿ“„ App\Providers\AppServiceProvider.php

๐Ÿ” Preparing the Authentication Model (JWT & Sanctum)

This package supports JWT authentication and Sanctum SPA authentication.
Your authentication model (usually User) must be configured correctly.


JWT & Sanctum Model Setup (Required)

To enable JWT and Sanctum authentication, update your auth model (usually User) as follows:

  1. Implement JWTSubject
  2. Use HasApiTokens trait
  3. Add the two JWT methods

If you are using JWT authentication, you must also define a JWTSubject interface in your model. And if you are using Sanctum authentication, you must also define a HasApiTokens trait in your model.

If you are using JWT and want to use middleware, you can use the auth:jwt middleware. And if you are using Sanctum, you can use the auth:sanctum middleware.

Default:

๐Ÿ” Authentication

1. JWT Authentication

Ideal for mobile apps and external clients.

To disable, set `API_ENABLE_JWT=false`

2. Sanctum SPA Authentication

Optimized for first-party web applications.

To disable, set `API_ENABLE_SANCTUM=false`

Custom Auth Model

You can define which model is used for authentication (e.g., for an Admin panel):

Note: Your model must extend Illuminate\Foundation\Auth\User and use the HasApiTokens trait.


๐Ÿ“Š API Response Format

All responses are returned as structured JSON.

Success Response

Error Response


Swagger Setup (Optional)

Install Swagger:

Edit the generated file:

๐Ÿ“„ config/l5-swagger.php

Update the annotations paths:

๐Ÿ” REQUIRED: Sanctum Security Scheme (Swagger)

Make sure this exists in config/l5-swagger.php

Generate documentation:

Access Swagger UI at:

/api/documentation


๐Ÿ›  Features in Detail

Health Check

Monitor your application status easily.

Rate Limiting

Prevent abuse with built-in throttling (per IP).


๐Ÿงช Testing

Run the package test suite:


๐Ÿš€ Roadmap


๐Ÿ“„ License

The MIT License (MIT). Please see License File for more information.

ยฉ 2026 Dwivedianuj9118


All versions of laravel-api-starter with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version ^11.0 || ^12.0
laravel/sanctum Version ^4.0
tymon/jwt-auth Version ^2.0
darkaonline/l5-swagger Version ^9.0
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 dwivedianuj9118/laravel-api-starter contains the following files

Loading the files please wait ...