mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 16:22:14 +00:00
frontend update
This commit is contained in:
51
app/Http/Resources/InvoiceResource.php
Normal file
51
app/Http/Resources/InvoiceResource.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class InvoiceResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'data' => [
|
||||
'id' => (string)$this->id,
|
||||
'type' => 'invoices',
|
||||
'attributes' => [
|
||||
'token' => $this->token,
|
||||
'order' => $this->order,
|
||||
'user_id' => $this->user_id,
|
||||
'plan_id' => $this->plan_id,
|
||||
'notes' => $this->notes,
|
||||
'total' => $this->total,
|
||||
'currency' => $this->currency,
|
||||
'seller' => $this->seller,
|
||||
'client' => $this->client,
|
||||
'bag' => $this->bag,
|
||||
'created_at_formatted' => format_date($this->created_at),
|
||||
'created_at' => $this->created_at,
|
||||
'updated_at' => $this->updated_at,
|
||||
]
|
||||
],
|
||||
'relationships' => [
|
||||
'user' => [
|
||||
'data' => [
|
||||
'id' => (string)$this->user->id,
|
||||
'type' => 'user',
|
||||
'attributes' => [
|
||||
'name' => $this->user->name,
|
||||
'avatar' => $this->user->avatar,
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user