for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Ijeffro\Laralocker\LearningLocker\Stores;
use Ijeffro\Laralocker\LearningLocker\API\APIHandler;
class StoreHandler extends APIHandler {
private $store = '/lrs';
private $api = '/api';
private $v1 = '/v1';
$v1
private $v2 = '/v2';
protected $headers = [
'Accept' => 'application/json',
'Content-Type' => 'application/json'
];
public function __construct($id = null) {
parent::__construct();
$this->id = $id ? $id : null;
id
}
/**
* Learning Locker: Request Organisation Details
*
* @return $response
$response
0
*/
public function get($selected = []) {
try {
$url = $this->url . $this->api . $this->v2 . $this->store . '/' . $this->id ?? $this->id;
$response = $this->request($url);
if ($selected) $response = $this->select($selected, $response);
return $response;
} catch (Exception $e) {
Ijeffro\Laralocker\LearningLocker\Stores\Exception
Exception
\
return $e;
* Learning Locker: Update Store
public function update($data) {
$url = $this->url . $this->api . $this->v2 . $this->store . '/' . $this->id;
$response = $this->save($url, $data);
public function delete() {
$response = $this->destroy($url);
public function create($data = null) {
$url = $this->url . $this->api . $this->v2 . $this->store;
$response = $this->make($url, $data);