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

Did you run composer dump-autoload after adding the namespace?

0

TerrePorter said:

Did you run composer dump-autoload after adding the namespace?

Thank you TerrePorter. I done it, but same as before.

0

A couple things to try,

Eliminate the view to confirm data,

class BlogsController extends \BaseController {
    public function index()
    {
        $clubid = Session::get('clubid');


// dump the db data
         dd( Blog::clubBlog($clubid)->get()->toArray() );

        return \View::make('default.public.default')->with('blogs',Blog::clubBlog($clubid)->get());
    }

Another thing would be the look in the composer autoload and see if it has the model in the list of known classes, vendor/composer/autoload_classmap.php

actually this might be the issue, check the composer.json to make sure it is set to include the models folder in the autoload

"autoload": {
		"classmap": [
			"app/models",
...

0

TerrePorter said:

A couple things to try,

Eliminate the view to confirm data,

class BlogsController extends \BaseController {
   public function index()
   {
       $clubid = Session::get('clubid');


// dump the db data
        dd( Blog::clubBlog($clubid)->get()->toArray() );

       return \View::make('default.public.default')->with('blogs',Blog::clubBlog($clubid)->get());
   }

Another thing would be the look in the composer autoload and see if it has the model in the list of known classes, vendor/composer/autoload_classmap.php

actually this might be the issue, check the composer.json to make sure it is set to include the models folder in the autoload

"autoload": {
  	"classmap": [
  		"app/models",
...

I have checked autoload_classmap.php and found one mistake with 'Blog' model. Thank you very much!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

shuli1984 shuli1984 Joined 7 May 2015

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.