2017 © Pedro PelĂĄez
 

library laravel-httplug

Laravel package to integrate the Httplug generic HTTP client into Laravel

image

php-http/laravel-httplug

Laravel package to integrate the Httplug generic HTTP client into Laravel

  • Wednesday, November 2, 2016
  • by Nyholm
  • Repository
  • 7 Watchers
  • 8 Stars
  • 17,117 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 4 Open issues
  • 2 Versions
  • 32 % Grown

The README.md

Laravel-Httplug

Latest Version Software License Build Status Code Coverage Quality Score Total Downloads, (*1)

Install

Via Composer, (*2)

``` bash $ composer require php-http/laravel-httplug, (*3)


With Laravel 5.5 or newer, the package will be discovered automatically. If you're using an older version of Laravel, add the following to your `config/app.php`: ```php <?php // config.app 'providers' => [ ..., ..., Http\Httplug\HttplugServiceProvider::class, ], 'aliases' => [ ..., ..., 'Httplug' => Http\Httplug\Facade\Httplug::class, ],

Publish the package config file to config/httplug.php:, (*4)

php artisan vendor:publish --provider="Http\Httplug\HttplugServiceProvider"

Usage

<?php

// Create a request using a MessageFactory
$factory = app()->make('httplug.message_factory.default');
$request = $factory->createRequest('GET', 'http://httpbin.org');

$httplug = app()->make('httplug');

// Send request with default driver
$response = $httplug->sendRequest($request);

// Send request with another driver
$response = $httplug->driver('curl')->sendRequest($request);

// Send request with default driver using facade
$response = Httplug::sendRequest($request);

// Send request with another driver using facade
$response = Httplug::driver('curl')->sendRequest($request)

Testing

bash $ composer test, (*5)

Contributing

Please see our contributing guide., (*6)

Security

If you discover any security related issues, please contact us at security@php-http.org., (*7)

License

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

The Versions