phase 8 and 9
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\V1;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class EventResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'name' => $this->name,
|
||||
'category' => $this->category,
|
||||
'total' => (int) $this->total,
|
||||
'unique_visitors' => (int) $this->unique_visitors,
|
||||
'total_value' => $this->total_value ? round((float) $this->total_value, 4) : null,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user