point-backend/app/Http/Resources/dashboard/QuotationResource.php
2024-04-03 12:10:28 +03:00

33 lines
752 B
PHP

<?php
namespace App\Http\Resources\dashboard;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Facades\Config;
class QuotationResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
$app_base_url = Config::get('appSetting.app_base_url');
return [
"id"=> $this->id,
'name' => $this->name,
'phone' => $this->phone,
'email' => $this->email,
'message' => $this->message,
'attachment' => $this->attachment ? $app_base_url . $this->attachment : null,
];
}
}