prusmarcin/laravel-rest-client

Package Rest Full Client for Laravel 5.6

dev-master 2018-04-10 09:38 UTC

This package is not auto-updated.

Last update: 2024-04-18 08:44:53 UTC


README

Package Rest Full API client for Laravel

You can see package Server API package laravel-rest-server for use on a separate Laravel installation

Total Downloads Latest Stable Version License

Installation

To install this package you will need:

Laravel 5 (see compatibility table)
PHP 7.0 +

Install via composer - edit your composer.json to require the package.

{
    "require": {
        "prusmarcin/laravel-rest-client": "dev-master"
    }
}

Then run composer update in your terminal to pull it in.

Or via the command line in the root of your application installation.

$ composer require prusmarcin/laravel-rest-client

Once this has finished, you will need to add the service provider to the providers array in your app.php config as follows:

\Restclient\RestclientServiceProvider::class,

Then execute this command

$ php artisan vendor:publish

Select provider from lists Provider: Restclient\RestclientServiceProvider and confirm.

Then enter the config directory in your Laravel installation and open the restclient.php file. Edit url value where your Rest Full API server is located.

return [

    /*
    |--------------------------------------------------------------------------
    | URL Rest Server API
    |--------------------------------------------------------------------------
    */

    'url' => 'http://127.0.0.1:8000/api/'

];

And you're done!

Usage

Run this url in browser http://localhost/laravelzadanie/test/public/products

WHERE http://localhost/laravelzadanie/test/public/ <- is source your installation Laravel

If everything works, you'll see what's on the screenshot

Screenshot

To view all products just enter http://localhost/laravelzadanie/test/public/products/available

You'll see

Screenshot

Author

License

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