from server
This commit is contained in:
parent
062ce7b528
commit
6ff0175ae6
|
|
@ -59,7 +59,7 @@ class BlogPostsApiController extends Controller
|
|||
'translations:locale,model_id,attribute_data'
|
||||
])->paginate(9);
|
||||
|
||||
return $this->helpers->apiArrayResponseBuilder(200, 'ok', [$data]);
|
||||
return response()->json($data, 200);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -134,8 +134,13 @@ class ProductsAPIController extends Controller
|
|||
'translations:locale,model_id,attribute_data',
|
||||
'images:attachment_id,attachment_type,disk_name,file_name',
|
||||
'vendor:id,name,surname,email,username,logo,banner',
|
||||
'files', 'place'
|
||||
])->find($id);
|
||||
'files', 'place',
|
||||
])
|
||||
->withCount('comments')->withAvg('comments', 'rating')
|
||||
// ->withCount(['comments as comments_avg_votes' => function($query) {
|
||||
// $query->select(DB::raw('avg(rating)'));
|
||||
// }])
|
||||
->find($id);
|
||||
|
||||
$data->main_path = 'http://78.111.88.8:9086' . \Config::get('cms.storage.media.path');
|
||||
|
||||
|
|
|
|||
|
|
@ -32,11 +32,13 @@ Route::group(['prefix' =>'api/v1','namespace' =>'AhmadFatoni\ApiGenerator\Contro
|
|||
|
||||
Route::get('get/product/comments', 'BlogPostsApiController@getProductComment');
|
||||
|
||||
Route::get('notifications', 'BlogPostsApiController@getNotifications');
|
||||
|
||||
// Route::get('account/{id}/sliders', 'BlogPostsApiController@getAccountSliders')->where(['id' => '[0-9]+']);
|
||||
Route::get('account/{id}/products', 'BlogPostsApiController@getAccountProducts')->where(['id' => '[0-9]+']);
|
||||
Route::get('account/{id}/datas', 'BlogPostsApiController@getAccountDatas');
|
||||
|
||||
Route::get('notifications', 'BlogPostsApiController@getNotifications');
|
||||
|
||||
|
||||
Route::middleware(['\Tymon\JWTAuth\Middleware\GetUserFromToken'])->group(function () {
|
||||
Route::post('update/vendor/data', 'VendorApiController@updateVendor');
|
||||
|
|
@ -74,22 +76,10 @@ Route::group(['prefix' =>'api/v1','namespace' =>'AhmadFatoni\ApiGenerator\Contro
|
|||
->where('seller_id', '[0-9]+');
|
||||
|
||||
//Balance
|
||||
Route::post('balance_update','TransactionsApiController@updateBalance');
|
||||
|
||||
// Route::post('balance_bank_transfer','BalanceController@createBankTransfer');
|
||||
|
||||
Route::get('notifications', 'NotificationsApiController@index');
|
||||
Route::post('notifications/{id}/read', 'NotificationsApiController@markAsRead')
|
||||
->where('id', '^(?=.*[a-z])(?=.*[\-])(?=.*\d)[a-z\d\-]{36,}$');
|
||||
|
||||
Route::get('transactions', 'TransactionsApiController@index');
|
||||
Route::get('my-balance', 'TransactionsApiController@myBalance');
|
||||
|
||||
Route::post('withdraw-from-balance', 'ExchangeRequestsController@withdrawFromBalance');
|
||||
|
||||
Route::post('send-sms-code', 'SmsController@sendSmsCode');
|
||||
Route::post('check-sms-code', 'SmsController@checkSmsCode');
|
||||
|
||||
Route::post('send-email-verification-link', 'EmailVerificationController@sendEmailVerificationLink');
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue