|
|
@@ -3,6 +3,7 @@
|
|
|
namespace App\Http\Resources;
|
|
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
+use App\Http\Api\UserApi;
|
|
|
|
|
|
class CourseResource extends JsonResource
|
|
|
{
|
|
|
@@ -14,6 +15,21 @@ class CourseResource extends JsonResource
|
|
|
*/
|
|
|
public function toArray($request)
|
|
|
{
|
|
|
- return parent::toArray($request);
|
|
|
+ return [
|
|
|
+ "id"=>$this->id,
|
|
|
+ "title"=> $this->title,
|
|
|
+ "subtitle"=> $this->subtitle,
|
|
|
+ "teacher"=> UserApi::getById($this->teacher),
|
|
|
+ "course_count"=>10,
|
|
|
+ "type"=> 1,
|
|
|
+ "anthology_id"=> '',
|
|
|
+ "start_at"=> $this->start_at,
|
|
|
+ "end_at"=> $this->end_at,
|
|
|
+ "content"=> $this->content,
|
|
|
+ "content_type"=> $this->content_type,
|
|
|
+ "cover"=> $this->cover,
|
|
|
+ "created_at"=> $this->created_at,
|
|
|
+ "updated_at"=> $this->updated_at,
|
|
|
+ ];
|
|
|
}
|
|
|
}
|