Download the PHP package randomstate/laravel-api without Composer

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

laravel-api

Laravel Integration for randomstate/api.

Note, for a framework agnostic starter, use randomstate/api. You will need to do some significant wiring up to make it as useful as this Laravel package.

What it does

LaravelApi is an API versioning package that allows you to namespace and version your APIs (web, ajax, rest etc) easily. It comes with out of the box support and integration for the fantastic league/fractal package.

In essence, this package allows you to standardise the output of your API while maintaining flexibility; using namespaces to change context. Add to that the fact you can version your API responses to target particular users, and you have the start to a blissful API building experience.

Installation and Setup

composer require randomstate/laravel-api

Add \RandomState\LaravelApi\LaravelApiServiceProvider::class to your app.php config file.

Publish the configuration file by running: php artisan vendor:publish --tag=laravel-api

Because of the deep routing integration required to make the magic work, you need to replace the Http Kernel with the one provided in this package. You should change the app/Http/Kernel.php class to extend RandomState\LaravelApi\Http\Kernel instead of the HttpKernel default.

Namespace Setup

To namespace your routes, you can utilise the RandomsState\LaravelApi\Http\Middleware\ApiNamespace middleware class. Add the following to the $routeMiddleware property on your Kernel class.

Usage

Namespacing

If you followed the setup instructions you will have added a 'namespace' middleware. You can use this as so:

Dynamic Versioning

Since the intended use case for this package is to dynamically provide your API depending on your users' target version, I recommend the following way of versioning your routes automatically: In a service provider register method, (such as AppServiceProvider), you can add the following:

You must implement the storage and getApiVersion method yourself - this is just an example of how you could do it.


All versions of laravel-api with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
randomstate/api Version ^0.5.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 randomstate/laravel-api contains the following files

Loading the files please wait ....