|
|
|
@ -57,7 +57,7 @@ class PublicController extends Controller
|
|
|
|
$pageLength = request()->pageLength ? (int)request()->pageLength : 3;
|
|
|
|
$pageLength = request()->pageLength ? (int)request()->pageLength : 3;
|
|
|
|
$data = $data->with(["type" => function ($query) {
|
|
|
|
$data = $data->with(["type" => function ($query) {
|
|
|
|
$query->select("id", "name");
|
|
|
|
$query->select("id", "name");
|
|
|
|
}])->select("id", "type_id", "title","poster", "video", "published_at")->orderBy("published_at")->paginate($pageLength);
|
|
|
|
}])->select("id", "type_id", "title", "poster", "video", "published_at")->orderBy("published_at")->paginate($pageLength);
|
|
|
|
return response()->json($data->toArray());
|
|
|
|
return response()->json($data->toArray());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -78,8 +78,9 @@ class PublicController extends Controller
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$video = Training::with(["type" => function ($query) {
|
|
|
|
$video = Training::with(["type" => function ($query) {
|
|
|
|
$query->select("id", "name");
|
|
|
|
$query->select("id", "name");
|
|
|
|
}])->select("id", "type_id", "title","poster", "video", "published_at")->find($id);
|
|
|
|
}])->select("id", "type_id", "title", "poster", "video", "published_at")->find($id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return response()->json($video->toArray());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|