lundi 13 février 2017

Eloquent query in not returning object that I know exists?

I am running the following Eloquent query in a function, and nothing is being returned.

$foo = Foo::whereId(idHere)->first();       
Log::info($job);

Null is being returned, and I know that the object exists, I can access it in other places (controllers, views, etc.) Am I not including something that needs to be included in order to make Eloquent queries work? Here is what the include looks like at the top of this file:

use App\Core\Models\Foo;
use Log;
use Carbon\Carbon;
use BAR\Http\Controller; //CUSTOM CONTROLLER THING, NOT THE PROBLEM



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire