Download the PHP package kosmosx/laravel-response without Composer

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

Documentation

Let's go

Composer

composer require kosmosx/laravel-response

Laravel / Lumen register providers

Kosmosx\Response\Laravel\ResponseServiceProvider

Register handler Execptions (LaravelHandler or LumenHandler)

$this->app->singleton(
    \Illuminate\Contracts\Debug\ExceptionHandler::class,
    \Kosmosx\Response\Laravel\Exceptions\.....::class
);

Use

use Kosmosx\Response\RestResponse;
use RestResponse; //Facade alias 
use FactoryResponse; //Or use factory class

Benchmark

Same PC hardware (RAM: 16GB (2x8 GB) DDR4 2133 MHz, CPU: Intel Core i5 7400 Quad Core & 4 Thread 3.0GHz)

Illuminate/Response

Response weight 4.26Mb in 158~161ms

$app = array();
for ($x = 0; $x <= 1000; $x++) {
    $app[$x] = new JsonResponse(array('data'=>[true,false], "message" => 'Microservice Lumen work', "state" => "OK"));
}
return var_dump($app);

Kosmosx/Response

Response weight 3.6Mb in 148~151ms

$app = array();
for ($x = 0; $x <= 1000; $x++) {
    $app[$x] = new RestResponse(array('data'=>[true,false], "message" => 'Microservice Lumen work', "state" => "OK"));
}
return var_dump($app);

Response weight 3.6Mb in 220~223ms

$app = array();
for ($x = 0; $x <= 1000; $x++) {
    $app[$x] = $this->response->success()
        ->withMessage('Microservice Lumen work')
        ->withData(true)
        ->withData(false)
        ->withState();
}
return var_dump($app);

Results

Kosmosx/Response it is 15.50% smaller than Illuminate
Kosmosx/Response it is 6.3% faster than Illuminate (if use constructor)

en: documentation

it: documentazione


If you find a bug or want to contribute, write to [email protected]


All versions of laravel-response with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.3
kosmosx/response Version ~1.0
kosmosx/helpers Version ~1.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 kosmosx/laravel-response contains the following files

Loading the files please wait ....