command laravel for php artisan make :auth
composer require laravel/ui
php artisan ui vue --auth
command laravel for php artisan make :auth
composer require laravel/ui
php artisan ui vue --auth
laravel curl request
$client = new GuzzleHttp\Client;
$response = $client->get('https://api.example.com/api/AvailabilitySearch', [
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN_HERE',
],
'form_params' => [
'VisitDate' => '2017-05-08',
'PartySize' => '2',
'ChannelCode' => 'ONLINE',
],
]);
// You need to parse the response body
// This will parse it into an array
$response = json_decode($response->getBody(), true);
/////////////////////////////////////////////////////
$endpoint = "http://my.domain.com/test.php";
$client = new \GuzzleHttp\Client();
$id = 5;
$value = "ABC";
$response = $client->request('GET', $endpoint, ['query' => [
'key1' => $id,
'key2' => $value,
]]);
// url will be: http://my.domain.com/test.php?key1=5&key2=ABC;
$statusCode = $response->getStatusCode();
$content = $response->getBody();
// or when your server returns json
// $content = json_decode($response->getBody(), true);
how to display the responce of curl in php
$response = get_web_page("http://socialmention.com/search?q=iphone+apps&f=json&t=microblogs&lang=fr");
$resArr = array();
$resArr = json_decode($response);
echo "<pre>"; print_r($resArr); echo "</pre>";
function get_web_page($url) {
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_FOLLOWLOCATION => true, // follow redirects
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
CURLOPT_ENCODING => "", // handle compressed
CURLOPT_USERAGENT => "test", // name of client
CURLOPT_AUTOREFERER => true, // set referrer on redirect
CURLOPT_CONNECTTIMEOUT => 120, // time-out on connect
CURLOPT_TIMEOUT => 120, // time-out on response
);
$ch = curl_init($url);
curl_setopt_array($ch, $options);
$content = curl_exec($ch);
curl_close($ch);
return $content;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us