javineo
122
4
Laravel

Other Laravel 4.2 to Laravel 5.0

Posted 1 year ago by javineo

My problems continue making Laravel 4.2 become Laravel 5.0.

This is a error:

Undefined property: Illuminate\Database\Eloquent\Collection::$socios (View: C:\NeoWebServer\www\homebanking5\resources\views\submenus\operaciones.blade.php) 

line of code that gives the eror in the view

@if(Session::has('es_socio') && Session::get('es_socio') == '1' && $modulo->socios && $modulo->getItemsEnabled('escritorio') > 0)

$ module comes from model Model.php

    public function getItemsEnabled($menu = 'escritorio'){
        $count = 0;
        
        foreach($this->items as $i){
            if($i->$menu){
                $count++;
            }
            Log::info($count);
        }

        return $count;

What is my mistake? I can not understand what happens, I appreciate if someone can help me with this new error.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.