Try to fix your models by using a singular name for each class and check also the namespaces:
namespace YourModelsNamespace;
class User extends Eloquent
{
protected $table = 'users';
public function albums()
{
return $this->hasMany('YourModelsNamespace\Album');
}
}
namespace YourModelsNamespace;
class Album extends Eloquent
{
protected $table = 'albums';
public function photos()
{
return $this->hasMany('YourModelsNamespace\Photo');
}
}
namespace YourModelsNamespace;
class Photo extends Eloquent
{
protected $table = 'photos';
}
And use the load() method to eager load the relationships:
@foreach(Auth::user()->load('albums', 'albums.photos')->albums as $album)
{{ $album->name . ' (' . $album->photos->count() . ')' }}
@endforeach