Package Rest Full Client for Laravel 5.6
Package Rest Full API client for Laravel, (*1)
You can see package Server API package laravel-rest-server for use on a separate Laravel installation, (*2)
To install this package you will need:, (*4)
Laravel 5 (see compatibility table) PHP 7.0 +
Install via composer - edit your composer.json
to require the package., (*5)
``` json { "require": { "prusmarcin/laravel-rest-client": "dev-master" } }, (*6)
Then run `composer update` in your terminal to pull it in. Or via the command line in the root of your application installation. ``` bash $ 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:, (*7)
``` php \Restclient\RestclientServiceProvider::class,, (*8)
Then execute this command ``` bash $ php artisan vendor:publish
Select provider from lists Provider: Restclient\RestclientServiceProvider
and confirm., (*9)
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., (*10)
``` php return [, (*11)
/* |-------------------------------------------------------------------------- | URL Rest Server API |-------------------------------------------------------------------------- */ 'url' => 'http://127.0.0.1:8000/api/'
]; ```, (*12)
And you're done!, (*13)
Run this url in browser http://localhost/laravelzadanie/test/public/products
, (*14)
WHERE http://localhost/laravelzadanie/test/public/
<- is source your installation Laravel, (*15)
If everything works, you'll see what's on the screenshot, (*16)
, (*17)
To view all products just enter http://localhost/laravelzadanie/test/public/products/available
, (*18)
You'll see, (*19)
, (*20)
The MIT License (MIT). Please see License File for more information., (*21)