first commit

This commit is contained in:
2025-11-04 16:23:40 +05:00
commit 6486a35c03
4772 changed files with 506723 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class CourseResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
*/
public function toArray($request)
{
return [
"id" => $this->id,
"start_date" => $this->start_date,
"end_date" => $this->end_date,
"total_fee" => $this->total_fee,
"certificate_issued_at" => $this->certificate_issued_at,
"notes" => $this->notes,
"paid_amount" => $this->paid_amount,
"category" => $this->category ? new CategoryResource($this->category):null,
'transactions' => TransactionResource::collection($this->allTransactions)
];
}
}