php


Laravel 5.1, PHP 7.0: WhereNotIn not working


we have this 2 eloquent script which retrieves a user video based on the filter. I know this is working before because I haven't received any complains from the testers and my superiors have verified it is working.
$previous_winners = Stage::whereNotNull('win_date')
->where('win_date','>',Carbon::now()->subDays(8)->format('Y-m-d H:i:s'))
->lists('userId')
->toArray();
output for the 1st script is like:
array:4 [
0 => 84
1 => 361
2 => 304
3 => 326
]
but the output of the script below is null
$stage = Stage::whereIn('stageId',$id)
->whereNull('win_date')
->whereNotIn('userId',$previous_winners)
->where('stageId','!=',Config::get('constants.intro'))
->where('stageId','!=',88)
->first();
When the controller is called I always get a null value for the 2nd script even though when I checked the data it should retrieve one as I forced it to return results. The issue that I found out is that when removing this line ->whereNotIn('userId',$previous_winners) i get the correct results but when I put it back again i only get null values. I tried moving the whereNotIn to different positions from the first and before the end but as long as it is present I only get null values. Any idea or workaround on this one, please? Thanks.

Related Links

MethodNotAllowedHttpException in RouteCollection.php line 219
Output CSV to HTML using PHP
angular-laravel create users gives a query exception
php regex operation for url and # value detection [duplicate]
Dynamic variable not working in php
Laravel5.1 Route set all URL to Controller
How to search an index by value in two dimensional array in php
string concatenation not working in select options field
Trying to add words under wordpress user avatar, use add_filter get_avatar but fail to return data
Integrate CPT fields into Woocommerce checkout page
Mysql php query returns no result but record is present
Displaying puncuation in button data attribute
How to check if the function with parameter returns true or not
assign result of function call to variable in oop php
What's the best practice of getting a user's list of article likes from a database?
Error due to telephone field updation on Opencart 2.0.3.1

Categories

HOME
jboss
ontouchlistener
focus
jms
bokeh
swi-prolog
operating-system
stacktrace.js
vsts-build
mirc
google-webmaster-tools
azure-data-lake
impala
stored-procedures
javafx-8
minecraft
telegraf
siesta
spring-amqp
sonicwall
vmware-workstation
boomi
tfsbuild
renderscript
yii2-basic-app
kamailio
rxjs5
managed-c++
background-color
marquee
python-imageio
tsung
docx4j
autodesk-model-derivative
steam-web-api
publishing
seafile-server
ms-media-foundation
jfxtras
netstat
recovery
plane
uipickerview
klee
flipkart
spooler
ipp-protocol
android-5.0-lollipop
android-mediarecorder
nivo-slider
glimpse
gawk
petsc
yargs
rational-performance-test
libharu
always-on-top
cdo.message
android-sdcard
adp
polymerfire
persistent-object-store
currency-exchange-rates
psd
trust
certificate-authority
boost-proto
place
dsa
gluon-desktop
supercomputers
uitest
compositetype
modern.ie
relational-model
artisan
clarion
datagridcomboboxcolumn
ildasm
multivariate-testing
xhprof
communicate
forceclose
cidr
xmi
gpu-programming
oxygene
windows-taskbar
mft
mute
apportable
pcspim
uipangesturerecognizer
server-variables
botnet
pyjamas
downgrade
outlook-2007-addin
ntruencrypt
isapi-redirect
regioninfo

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile