2021-11-19 22:58:27 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Course\Resources;
|
|
|
|
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
|
2022-01-02 12:32:57 +01:00
|
|
|
/**
|
2022-11-22 00:37:34 +01:00
|
|
|
* @mixin \App\Course\Models\Course
|
2022-01-02 12:32:57 +01:00
|
|
|
*/
|
2021-11-19 22:58:27 +01:00
|
|
|
class CourseResource extends JsonResource
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Transform the resource into an array.
|
|
|
|
*
|
2022-03-11 20:19:17 +01:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
*
|
2021-11-19 22:58:27 +01:00
|
|
|
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
|
|
|
|
*/
|
|
|
|
public function toArray($request)
|
|
|
|
{
|
|
|
|
return [
|
2022-11-22 00:37:34 +01:00
|
|
|
'name' => $this->name,
|
|
|
|
'nami_id' => $this->nami_id,
|
2021-11-19 22:58:27 +01:00
|
|
|
'id' => $this->id,
|
2022-11-22 00:37:34 +01:00
|
|
|
'short_name' => $this->short_name,
|
2021-11-19 22:58:27 +01:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|