Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/RelationController.php
Show First 20 Lines • Show All 315 Lines • ▼ Show 20 Lines | public function show($id) | ||||
if (method_exists($resource, 'getConfig')) { | if (method_exists($resource, 'getConfig')) { | ||||
$response['config'] = $resource->getConfig(); | $response['config'] = $resource->getConfig(); | ||||
} | } | ||||
if (method_exists($resource, 'aliases')) { | if (method_exists($resource, 'aliases')) { | ||||
$response['aliases'] = $resource->aliases()->pluck('alias')->all(); | $response['aliases'] = $resource->aliases()->pluck('alias')->all(); | ||||
} | } | ||||
// Entitlements/Wallet info | |||||
if (method_exists($resource, 'wallet')) { | |||||
API\V4\SkusController::objectEntitlements($resource, $response); | |||||
} | |||||
return response()->json($response); | return response()->json($response); | ||||
} | } | ||||
/** | /** | ||||
* Get a list of SKUs available to the resource. | |||||
* | |||||
* @param int $id Resource identifier | |||||
* | |||||
* @return \Illuminate\Http\JsonResponse | |||||
*/ | |||||
public function skus($id) | |||||
{ | |||||
$resource = $this->model::find($id); | |||||
if (!$this->checkTenant($resource)) { | |||||
return $this->errorResponse(404); | |||||
} | |||||
if (!$this->guard()->user()->canRead($resource)) { | |||||
return $this->errorResponse(403); | |||||
} | |||||
return API\V4\SkusController::objectSkus($resource); | |||||
} | |||||
/** | |||||
* Fetch resource status (and reload setup process) | * Fetch resource status (and reload setup process) | ||||
* | * | ||||
* @param int $id Resource identifier | * @param int $id Resource identifier | ||||
* | * | ||||
* @return \Illuminate\Http\JsonResponse | * @return \Illuminate\Http\JsonResponse | ||||
*/ | */ | ||||
public function status($id) | public function status($id) | ||||
{ | { | ||||
Show All 28 Lines |