SQl queries are throwing error maria Db Offset Problem laravel php

Recently I have deleted my vendor folder and reinstalled. After that change my all get queries are throwing error. I have no clue what i am missing.

Thanks

/Error/

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘offset 0’ at line 1

My Code:

public function couponList(Request $request){
$sort_by = $request->get('sort-by');
$order_by = $request->get('order-by');
$homeTitle = 'Coupons and List';
$coupons = DB::table('sb_coupons AS CO')
->select('CO.*','CO.status as couponStatus','CO.created_at as couponOrderDate','UT.*',
'UT.firstname as userName')
->leftJoin('sb_customer AS UT', 'UT.customer_id', '=', 'CO.user_id');
if(!empty($request->s)){
$coupons->Where('CO.coupon_code', 'like', '%' . $request->s . '%');
}
if ($request->has('status')) {
$coupons->where('CO.status', $request->status);
}
$coupons = $coupons->paginate(env('RECORD_PER_PAGE'));
$coupons->appends($request->s);

return view('admin.coupons.coupon-list',array('homeTitle'=>$homeTitle,'coupons'=>$coupons,'params'=>$request, 'sort_by'=> $sort_by , 'order_by' => $order_by))
->with('i', ($request->input('page', 1) - 1) * env('RECORD_PER_PAGE'));
}

***.env *

APP_NAME=DeliverMyOrders
APP_ENV=local
APP_KEY=base64:LiLofkwJXFVZd4ZeUvGz/UADUFOeqx+Yeqv7L1gBHvY=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=delivermyorders
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
RECORD_PER_PAGE=10

FACEBOOK_ID=458516817946384
FACEBOOK_SECRET=9660233aee1cf8b443e4586ea864ea1a
FACEBOOK_URL=http://localhost:8000/auth/facebook/callback/


GOOGLE_ID=1512483269952
GOOGLE_SECRET=AIzaSyB-AiSA4Kd-R36M6J7NSTXxAWbVs7z4C_s
GOOGLE_URL=http://localhost:8000/auth/google/callback

from Newest questions tagged laravel-5 – Stack Overflow https://ift.tt/2S62Cxh
via IFTTT

Related Posts

Codeigniter : Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE) in Laravel project

I’m getting following error: **Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE)** Note : It’s working in local but facing issue in production server. private…

Firebase receive notification while tab is active or on focus

What i want is to be able to perform an action when a user receives a notification while the browser is open and tab is active or…

Laravel’s alias loader does not find class

We have a legacy project that we cannot update and we need to make some changes in symfony’s Response.php in vendor. We have solved this by copying…

Laravel 5 – generic document management

I have a system where you can create different types of unique documents. For instance, one document is called Project Identified and this expects certain inputs. Originally,…

Laravel Nova limit the results in indexQuery

I ran intro a situation where I need to limit the results of a resource to only 3 results. To be more specific, based on the logged…

Auditoria en laravel 5.8 [closed]

Cómo puedo automatizar el registro de actividades de un usuario en laravel? Si un usuario ingresa a un app de laravel, debo guardar toda su actividas, a…

Leave a Reply

Your email address will not be published.