from server afisha api

This commit is contained in:
root 2022-12-16 07:03:18 +00:00
parent acdf0448c8
commit 0e3993c61a
2 changed files with 13 additions and 1 deletions

View File

@ -28,6 +28,17 @@ class AfishaController extends Controller
return $this->helpers->apiArrayResponseBuilder(200, 'success', $data);
}
public function show($id){
$data = $this->Afisha::find($id);
if ($data){
return $this->helpers->apiArrayResponseBuilder(200, 'success', [$data]);
} else {
$this->helpers->apiArrayResponseBuilder(404, 'not found', ['error' => 'Resource id=' . $id . ' could not be found']);
}
}
}

View File

@ -10,7 +10,8 @@ Route::resource('{locale}/api/posts', 'AhmadFatoni\ApiGenerator\Controllers\API\
Route::get('api/v2/categories', 'AhmadFatoni\ApiGenerator\Controllers\API\CategoriesV2Controller@index');
Route::get('api/v2/afisha', 'AhmadFatoni\ApiGenerator\Controllers\API\AfishaController@index');
//Route::get('api/v2/afisha', 'AhmadFatoni\ApiGenerator\Controllers\API\AfishaController@index');
Route::resource('api/v2/afisha', 'AhmadFatoni\ApiGenerator\Controllers\API\AfishaController', ['except' => ['destroy', 'create', 'edit']]);
Route::get('api/version',function (){
return '2.0.8';