Internal requests

Submitted by xtrasmal - 4 years ago

If you have an API, which you also use on your site..then you might want to get the data from the API by making an internal request.

// ready the request
$request = Request::create('api/posts', 'GET');
// handle the response
$response = Route::dispatch($request);

// do something amazing

Ads cover the costs of maintaining Laravel-tricks

comments powered by Disqus

Ads cover the costs of maintaining Laravel-tricks