|
|
@@ -4,6 +4,7 @@ namespace App\Http\Resources;
|
|
|
|
|
|
use Illuminate\Http\Request;
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
+use Illuminate\Support\Facades\Storage;
|
|
|
|
|
|
class AssociateValidationResource extends JsonResource
|
|
|
{
|
|
|
@@ -11,16 +12,14 @@ class AssociateValidationResource extends JsonResource
|
|
|
{
|
|
|
return [
|
|
|
|
|
|
- 'id' => $this->id,
|
|
|
-
|
|
|
- 'name' => $this->name,
|
|
|
-
|
|
|
- 'cpf' => $this->cpf,
|
|
|
-
|
|
|
+ 'id' => $this->id,
|
|
|
+ 'name' => $this->name,
|
|
|
+ 'cpf' => $this->cpf,
|
|
|
'registration' => $this->registration,
|
|
|
-
|
|
|
- 'avatar' => $this->avatar,
|
|
|
-
|
|
|
+ 'photo_url' => $this->photo_path
|
|
|
+ ? Storage::disk('s3')->temporaryUrl($this->photo_path, now()->addHours(24))
|
|
|
+ : null,
|
|
|
+ 'expiry_date' => $this->expiry_date?->format('d/m/Y'),
|
|
|
];
|
|
|
}
|
|
|
}
|