PHP code example of missionx-co / laravel-better-http-fake
1. Go to this page and download the library: Download missionx-co/laravel-better-http-fake library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
missionx-co / laravel-better-http-fake example snippets
class Service {
public function createInstance($data) {
return $this->client()->post('/instances', $data)->json();
}
public function client(): PendingRequest {
return Http::baseUrl('https://service.com')
->withToken(config('services.service.api_key'));
}
}