mirror of
https://koodu.h-i.works/projects/thebadspace
synced 2025-06-25 16:04:37 -05:00
Added public search API
Finally moved over the public search API from the old version and updated the about page to show the new data structure Also tweaked the location update script to change 'defederate' to 'suspend' for the sake of consistency
This commit is contained in:
24
app/Http/Resources/LocationCollection.php
Normal file
24
app/Http/Resources/LocationCollection.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\ResourceCollection;
|
||||
|
||||
class LocationCollection extends ResourceCollection
|
||||
{
|
||||
/**
|
||||
* Transform the resource collection into an array.
|
||||
*
|
||||
* @return array<int|string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
//return parent::toArray($request);
|
||||
|
||||
return [
|
||||
'listingCount' => count($this->collection),
|
||||
'locations' => LocationResource::collection($this->collection),
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user