from server afisha api
This commit is contained in:
parent
acdf0448c8
commit
0e3993c61a
|
|
@ -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']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Reference in New Issue