add Rainfalls Index page
This commit is contained in:
19
app/Http/Resources/RainfallCollection.php
Normal file
19
app/Http/Resources/RainfallCollection.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\ResourceCollection;
|
||||
|
||||
class RainfallCollection extends ResourceCollection
|
||||
{
|
||||
/**
|
||||
* Transform the resource collection into an array.
|
||||
*
|
||||
* @return array<int|string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return ['data' => $this->collection];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user