Download the PHP package dantepiazza/laravel-base without Composer

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

dantepiazza/laravel-base

Base package for Laravel backend projects. Provides a pre-configured bootstrap/app.php, standardized middleware, structured API responses, webhook handling, error tracking, and API documentation — all publishable via a single command.


Requirements


Installation

Publish all stubs at once:

Or publish individually:

Tag Publishes
laravel-base Everything below at once
laravel-base-bootstrap bootstrap/app.php
laravel-base-logging config/logging.php
laravel-base-cors config/cors.php
laravel-base-sentry config/sentry.php
laravel-base-controller app/Http/Controllers/Controller.php
laravel-base-env .env.example
laravel-base-docker Dockerfile, docker-compose.yml and all Docker config files

Scribe config is merged from the package by default — no need to publish it unless you need to customize it:


Environment variables


Features

1. Base Controller — dantepiazza/laravel-api-response

This package requires dantepiazza/laravel-api-response and pre-wires it into the base Controller stub. After publishing, every controller in your project gets ApiResponse injected automatically:

Usage in any controller:


2. Middleware

ForceJsonResponse

Forces Accept: application/json on every request so Laravel always returns JSON errors. Register it globally in bootstrap/app.php:

GlobalHeaders

Attaches standard headers to every API response. Register it in bootstrap/app.php:

Headers added to every response:

Header Description
X-Maintenance Whether the service is in maintenance mode (app.maintenance)
X-Cache-Last-Update ISO 8601 timestamp of last cache invalidation (app.cache_last_update)
X-Correlation-ID Trace ID — reused from the incoming request or generated as UUID v4

The X-Correlation-ID is also injected back into the request object so any controller or service can read it:


3. Webhook handling

The package ships a generic WebhookController that receives webhooks from any source, verifies the signature, and dispatches a Laravel event asynchronously.

Route setup

The controller expects a {source} route parameter that identifies the origin:

This dispatches events named webhook.{source}.{event_type}, so each origin is isolated:

URL called Event dispatched
POST /webhooks/convoy webhook.convoy.invoice.created
POST /webhooks/stripe webhook.stripe.charge.succeeded
POST /webhooks/github webhook.github.push

Signature verification

By default the controller rejects all requests (verifySignature returns false). To enable a source, extend the controller and override the method:

Then point the route to your controller:

Listening to webhook events

Payload passed to every listener:


4. Exception handling (bootstrap/app.php)

The published bootstrap/app.php includes a full exception handler wired to dantepiazza/laravel-api-response:

Exception HTTP status Response
ValidationException 422 Field-level errors via validationError()
AuthenticationException 401 unauthorized()
AccessDeniedHttpException 403 forbidden()
NotFoundHttpException / ModelNotFoundException 404 notFound()
ThrottleRequestsException 429 tooManyRequests()
Throwable (catchall) 500 server_error with message

Rate limiters included out of the box:

Limiter Limit Keyed by
api 120 req/min user ID or IP
auth 10 req/min IP
microservices 600 req/min IP

5. GlitchTip / Sentry error tracking

Uses sentry/sentry-laravel, which is fully compatible with GlitchTip. Publish the config and set the DSN:

The X-Correlation-ID on every request can be used to correlate GlitchTip events with specific API calls.


6. Logging

The published config/logging.php includes a pre-configured stack with daily file rotation and optional Slack alerts for critical errors:


7. API Documentation (Scribe)

Scribe is configured out of the box — the package merges its own config/scribe.php automatically, no publishing needed.

To generate docs:

To customize the config for a specific project:


8. Docker

A production-ready Docker setup is included. Publish it with:

Publishes:


Package structure


All versions of laravel-base with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
laravel/framework Version ^11.0|^12.0|^13.0
firebase/php-jwt Version ^7.0.5
dantepiazza/laravel-api-response Version ^1.0.0
sentry/sentry-laravel Version ^4.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 dantepiazza/laravel-base contains the following files

Loading the files please wait ...