PHP code example of iamalexchip / clawcrane
1. Go to this page and download the library: Download iamalexchip/clawcrane 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/ */
iamalexchip / clawcrane example snippets
use Iamalexchip\ClawCrane;
$users = User::get();
$clawcrane = new ClawCrane($users);
$template = '{"username": "", "firstname": "", "email": ""}';
$clawcrane->get($template);
/*
[
"data" => [
"users" => [
[
"username" => "zerochip",
"firstname" => "Alex"
],
[
"username" => "johndoe",
"firstname" => "John",
"email" => "[email protected]"
]
]
],
"errors" => [
"App\\User: attribute [email] access denied"
]
]
*/