Answer the question
In order to leave comments, you need to log in
How to pass variable to Laravel method?
$NUMBER = 533;
$result = vagprice::find($NUMBER); // doesn't find
$NUMBER = strval($NUMBER) // doesn't find
$result = vagprice::find($NUMBER); // doesn't find
$result = vagprice::find('533'); // finds
Answer the question
In order to leave comments, you need to log in
The problem is not the way the variable is passed. Nothing more can be said without the code.
Laravel itself casts the value to the string: https://github.com/laravel/framework/blob/aa81c2e5...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question