update deploy
This commit is contained in:
43
app/Http/Resources/LeadResource.php
Normal file
43
app/Http/Resources/LeadResource.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Models\Lead;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
/**
|
||||
* @mixin Lead
|
||||
*/
|
||||
class LeadResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
$utm = $this->utm;
|
||||
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'phone' => $this->phone,
|
||||
'email' => $this->email,
|
||||
'source' => $this->source?->value,
|
||||
'status' => $this->status?->value,
|
||||
'target_course' => $this->target_course,
|
||||
'education_level' => $this->education_level,
|
||||
'subject' => $this->subject,
|
||||
'message' => $this->message,
|
||||
'utm_source' => $utm['utm_source'] ?? null,
|
||||
'utm_medium' => $utm['utm_medium'] ?? null,
|
||||
'utm_campaign' => $utm['utm_campaign'] ?? null,
|
||||
'kvkk_consent' => $this->consent_kvkk,
|
||||
'marketing_consent' => $this->marketing_consent,
|
||||
'is_read' => $this->is_read,
|
||||
'admin_note' => $this->notes,
|
||||
'created_at' => $this->created_at?->toISOString(),
|
||||
'updated_at' => $this->updated_at?->toISOString(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user