Locations
5 source-verified application API operations in Aquadactyl.
Generated from Aquadactyl 2bfd6ae2a30c. Read authentication and conventions first.
GET /api/application/locations
Return all the locations currently registered on the Panel.
Access: Administrator account; locations ACL READ.
Source: Route · Controller · Request validation
Validation is inherited from ApplicationApiRequest.php.
Other controller inputs: per_page.
List query options: filters declared in 'short', 'long'; sorts 'id'. Use filter[name]=value and sort=-id only with supported fields.
Response
Success: 200. Response attributes: Application LocationTransformer. Collections use the list envelope described in conventions.
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
$locations = QueryBuilder::for(Location::query())
->allowedFilters('short', 'long')
->allowedSorts('id')
->paginate($request->query('per_page') ?? 50);
return $this->fractal->collection($locations)
->transformWith($this->getTransformer(LocationTransformer::class))
->toArray();Example request
curl --get "${PANEL_URL}/api/application/locations" \
--header "Authorization: Bearer ${APPLICATION_API_KEY}" \
--header "Accept: application/json"GET /api/application/locations/{location:id}
Return a single location.
Access: Administrator account; locations ACL READ.
Source: Route · Controller · Request validation
Validation is inherited from ApplicationApiRequest.php.
Path parameters: location:id. See identifiers.
Response
Success: 200. Response attributes: Application LocationTransformer. Collections use the list envelope described in conventions.
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
return $this->fractal->item($location)
->transformWith($this->getTransformer(LocationTransformer::class))
->toArray();Example request
curl --get "${PANEL_URL}/api/application/locations/RESOURCE_ID" \
--header "Authorization: Bearer ${APPLICATION_API_KEY}" \
--header "Accept: application/json"POST /api/application/locations
Store a new location on the Panel and return an HTTP/201 response code with the new location attached.
Access: Administrator account; locations ACL WRITE.
Source: Route · Controller · Request validation
Model constraints: Location.php (including runtime rules and uniqueness checks for updates).
Input fields
Rules use Laravel validation syntax. Dotted keys describe nested objects; * describes each array member. Model-derived rules are shown as their source expressions; model methods can add runtime constraints.
| Field | Validation |
|---|---|
long | 'string|nullable|between:1,191' |
short | 'required|string|between:1,60|unique:locations,short' |
Response
Success: 201. Response attributes: Application LocationTransformer. Collections use the list envelope described in conventions.
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
$location = $this->creationService->handle($request->validated());
return $this->fractal->item($location)
->transformWith($this->getTransformer(LocationTransformer::class))
->addMeta([
'resource' => route('api.application.locations.view', [
'location' => $location->id,
]),
])
->respond(201);PATCH /api/application/locations/{location:id}
Update a location on the Panel and return the updated record to the user.
Access: Administrator account; locations ACL WRITE.
Source: Route · Controller · Request validation
Model constraints: Location.php (including runtime rules and uniqueness checks for updates).
Path parameters: location:id. See identifiers.
Input fields
Rules use Laravel validation syntax. Dotted keys describe nested objects; * describes each array member. Model-derived rules are shown as their source expressions; model methods can add runtime constraints.
| Field | Validation |
|---|---|
short | 'required|string|between:1,60|unique:locations,short' |
long | 'string|nullable|between:1,191' |
Response
Success: 200. Response attributes: Application LocationTransformer. Collections use the list envelope described in conventions.
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
$location = $this->updateService->handle($location, $request->validated());
return $this->fractal->item($location)
->transformWith($this->getTransformer(LocationTransformer::class))
->toArray();DELETE /api/application/locations/{location:id}
Delete a location from the Panel.
Access: Administrator account; locations ACL WRITE.
Source: Route · Controller · Request validation
Validation is inherited from ApplicationApiRequest.php.
Path parameters: location:id. See identifiers.
Response
Success: 204 (empty body).
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
$this->deletionService->handle($location);
return response('', 204);