Download the PHP package membrane/laravel without Composer

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

Membrane-Laravel

Integrates Membrane-core with Laravel.

About

Middleware that validates the raw user input from incoming HTTP requests against your OpenAPI spec.
Adds a Membrane\Result\Result onto your Illuminate\Contracts\Container\Container.
The Result object contains the cleaned up data and additional details in the case of invalid requests.

Setup

Installation

Require the membrane/laravel package in your composer.json and update your dependencies:

Configuration

The defaults are set in config/membrane.php.
To publish a copy to your own config, use the following:

API Spec File

This is the absolute filepath of your OpenAPI.

By default, it looks for <your-project-directory>/api/openapi.yaml.

Validation Error Response Code

Set 'validation_error_response_code' to the integer value of the default http status code for invalid results.

Validation Error Response Type

Set 'validation_error_response_type' to the string value of the default response type for API problems.

API Problem Response Types

Within the 'api_problem_response_types' array: Set integer http status code => string response type pairs.
These are more specific and will override the default value set by 'validation_error_response_type'

Usage

Requests

The \Membrane\Laravel\Middleware\RequestValidation middleware will validate or invalidate incoming requests and let you decide how to react. You can follow it with your own custom middleware or with one of the following built-in options to produce an error response:

Responses

Any response middleware MUST follow the RequestValidation middleware as it requires the result object being added to your container.
These middlewares will check whether the request has passed or failed validation.
Invalid requests will return an appropriate response detailing the reasons the request was invalid.

Your response can be in one of the following formats.

Flat Json

\Membrane\Laravel\Middleware\ResponseJsonFlat

Nested Json

\Membrane\Laravel\Middleware\ResponseJsonNested

Global Usage

To use any of the above middlewares on all routes, go into your app/Http/Kernel.php and add them to your middleware array.

For example:


All versions of laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1.0
crell/api-problem Version ^3.6.1
illuminate/console Version ^9.0 || ^10.0
illuminate/http Version ^9.0 || ^10.0
illuminate/support Version ^9.0 || ^10.0
nyholm/psr7 Version ^1.8
membrane/membrane Version ^0.8
membrane/openapi-router Version ^0.4.0
symfony/psr-http-message-bridge Version ^2.1
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 membrane/laravel contains the following files

Loading the files please wait ....