diff --git a/app/Http/Controllers/Customer/PublicController.php b/app/Http/Controllers/Customer/PublicController.php index 07569b6..0a5b070 100644 --- a/app/Http/Controllers/Customer/PublicController.php +++ b/app/Http/Controllers/Customer/PublicController.php @@ -57,7 +57,7 @@ class PublicController extends Controller $pageLength = request()->pageLength ? (int)request()->pageLength : 3; $data = $data->with(["type" => function ($query) { $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()); } @@ -78,8 +78,9 @@ class PublicController extends Controller { $video = Training::with(["type" => function ($query) { $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()); } } diff --git a/routes/web.php b/routes/web.php index e33ea26..99ce5a5 100644 --- a/routes/web.php +++ b/routes/web.php @@ -96,6 +96,7 @@ Route::group(["namespace" => "Customer", "prefix" => "customer"], function () { Route::post('pay-callback', 'PayCallbackController@index'); Route::get('get-projects', 'PublicController@getProjects'); Route::get('get-training-videos', 'PublicController@getTrainingVideos'); + Route::get('get-training-video/{id}', 'PublicController@getTrainingVideo'); Route::group(['middleware' => ['authorize.jwt:customer']], function () { Route::get('get-product/{id}', 'OrdersController@getProduct');