please see the link (https://reqres.in/) for list of endpoints
This API wrapper use Faraday client, please install faraday client in your local env
gem install faraday
<?php | |
// Function to convert a file to base64 | |
function fileToBase64($filePath) { | |
if (file_exists($filePath)) { | |
$fileData = file_get_contents($filePath); | |
if ($fileData !== false) { | |
return base64_encode($fileData); | |
} else { | |
return false; // Error reading file |
# create magick shell command to convert the first page of PDF file into image format | |
# Usage: convert_magic.sh <PDF file> <image format> <output name> | |
# convert_magic.sh input.pdf png output.png | |
# check if the PDF file exists | |
if [ ! -f $1 ]; then | |
echo "File $1 does not exist" | |
exit 1 | |
fi |
1xx Informational | |
100 :continue | |
101 :switching_protocols | |
102 :processing | |
2xx Success | |
200 :ok | |
201 :created | |
202 :accepted | |
203 :non_authoritative_information |
use Psr\Http\Message\ServerRequestInterface; | |
function product(ServerRequestInterface $request) | |
{ | |
$name = "Banana"; | |
$phoneNumber = "62812334444" | |
$queryString = $request->getQueryParams(); | |
$name = $queryString['name'] ?? $name; | |
header("Location: https://api.whatsapp.com/send?phone=" . $phoneNumber . "&text=" . $name); |
please see the link (https://reqres.in/) for list of endpoints
This API wrapper use Faraday client, please install faraday client in your local env
gem install faraday
# Be sure to restart your server when you modify this file. | |
# Configure sensitive parameters which will be filtered from the log file. | |
Rails.application.config.filter_parameters += %i[ | |
passw password vendorable_id | |
] |
<div> | |
<div class="container-fluid"> | |
<div class="row"> | |
<div class="col-md-8"> | |
<b-card class="mb-3"> | |
<b-form inline> | |
<label class="sr-only" for="inline-form-input-username">Cari Produk</label> | |
<b-input-group class="mb-2 mr-sm-2 mb-sm-0" size="lg" style="width: 50%"> | |
<b-input id="search-product" placeholder="Cari produk..."></b-input> | |
<b-input-group-append> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Hello Vue</title> | |
</head> | |
<body> | |
<div id="app"> | |
<h1>{{ message }}</h1> | |
</div> | |
</body> |
<script> | |
export default { | |
data: () => ({ | |
form: { | |
id: 1 | |
text: 'ABC' | |
} | |
}), | |
watch:{ | |
'form.id': function (newVal, oldVal){ |
<?php | |
namespace App\Models\Traits; | |
use Carbon\Carbon; | |
trait DateFormater | |
{ | |
public function appDate($attribute, $format = null) | |
{ |