add all controllers logic
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Attendance;
|
||||
|
||||
use Illuminate\Http\Resources\Json\ResourceCollection;
|
||||
|
||||
class LateSlipLogCollection extends ResourceCollection
|
||||
{
|
||||
public $collects = LateSlipLogResource::class;
|
||||
|
||||
public function toArray($request): array
|
||||
{
|
||||
return parent::toArray($request);
|
||||
}
|
||||
|
||||
public function with($request): array
|
||||
{
|
||||
return [
|
||||
'meta' => [
|
||||
'total' => $this->resource->total() ?? null,
|
||||
'per_page' => $this->resource->perPage() ?? null,
|
||||
'current_page' => $this->resource->currentPage() ?? null,
|
||||
'last_page' => $this->resource->lastPage() ?? null,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Attendance;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class LateSlipLogResource extends JsonResource
|
||||
{
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->resource->id ?? null,
|
||||
'school_year' => $this->resource->school_year ?? null,
|
||||
'semester' => $this->resource->semester ?? null,
|
||||
'student_name' => $this->resource->student_name ?? null,
|
||||
'slip_date' => $this->resource->slip_date ?? null,
|
||||
'time_in' => $this->resource->time_in ?? null,
|
||||
'grade' => $this->resource->grade ?? null,
|
||||
'reason' => $this->resource->reason ?? null,
|
||||
'admin_name' => $this->resource->admin_name ?? null,
|
||||
'printed_by' => $this->resource->printed_by ?? null,
|
||||
'printed_at' => $this->resource->printed_at ?? null,
|
||||
'created_at' => $this->resource->created_at ?? null,
|
||||
'updated_at' => $this->resource->updated_at ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user