Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

Problem solved, for anyone else who might have a similar issue... the problem was with name spacing $blogs = App\Blog::all(); had to be changed to $blogs = \App\Blog::all();

Last updated 8 years ago.
0

If you plan on referencing that class again in that file, you could add a use at the top to alias it.

...
use App\Blog;

class .....
{
    public function show($id)
    {
        $blog = Blog::find($id);
        ...
    }
}    
Last updated 8 years ago.
0

I've just updated it and it's working perfectly, that seems to be a more permanent solution... thank you

0

Sign in to participate in this thread!

Eventy

Your banner here too?

yegaigulo yegaigulo Joined 19 Feb 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.