Undefined property: Illuminate\Database\Eloquent\Collection::$socios

Posted 1 year ago by javineo

Hello,

I have not been able to get out of this problem, I can not guide myself on how to solve it.

It gives me an error that I do not realize where to fix it.

DB Access:

class Modulo extends Model implements SluggableInterface {


    use SluggableTrait;

    protected $sluggable = array(
        'build_from' => 'modulo',
        'save_to'    => 'slug',
    );



    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'modules';

    public $timestamps = false;

Now ProfileComposer:

    public function compose(View $view)
    {
        $conf= Conf::first();
        $modulos= Modulo::all();
        //$users = User::all();
        $view->with('conf', $conf)->with('modulo', $modulos);
    }

View Code:

        @if(session()->has('es_socio') && session()->get('es_socio') == '1' && (Request::segment(2) === null || Request::segment(2) == 'resumen' || Request::segment(2) == 'consumos' || Request::segment(2) == 'dtohabermax') && $modulo->socios)


And this is a error:

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

If someone can help me, I thank you.

Total Thanks

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