Laravel Query Doesn't Retrive the given value I got an random array instead of value am actually passed on where condition,
my Actual query is
$data = Dataimp::where('name','Tesoro');
dd($data->toSql(),$data->getBindings());
My Raw Query & Binding data is as follows
"select * from "data_dial" where "name" = ?"
Builder {#373 ▼
#passthru: array:12 [▶ ]
#query: Builder {#371 ▶ }
#model: Dataimp {#360 ▶ }
#eagerLoad: []
#localMacros: []
#onDelete: null
#scopes: []
#removedScopes: []
}
Suggest some idea for this Issue...
No it is not a random array, the result is a Query Builder when you don't call get or first on it, so try one of this instead:
$data = Dataimp::where('name','Tesoro')->get(); // collection of datas
// or
$data = Dataimp::where('name','Tesoro')->first(); // the first row found
@tesoro
If you recently deployed you project to your production server or moved the project to another server, do not forget to clear the app cache by running these commands.
php artisan cache:clear
php artisan view:clear
php artisan config:cache
it should fix it.
Also consider updating your .env file to match new environment variables.
Actually i removed get to use toSql()....
If i use like this $data = Dataimp::where('name','Tesoro')->get();
it returns boolean values
@TESORO - Can you please try it out and share the result here? Because what you are saying does not make sense to me.
Please sign in or create an account to participate in this conversation.