jeudi 3 août 2017

Why suddenly I started getting No query results for model error in Laravel?

I don't know why I started getting the following error while working on Laravel application.

No query results for model [App\Hotspot].

Here is my Model Function to get user's hotspots.

public function hotspots()
{
    return $this->hasManyThrough(Hotspot::class, Operator::class, 'id', 'operator_id');
}

and here is how I am executing the query to get data.

$hotspotId = $id;
$hotspot = Auth::user()->hotspots()->findOrFail($hotspotId);

I started getting this error suddenly. I don't know what went wrong! I tried to find solution on internet but they are totally different cases.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2u88kWc
via IFTTT

Aucun commentaire:

Enregistrer un commentaire