Support the ongoing development of Laravel.io →
Authentication Session Eloquent

Hi Guys

I am trying to set it up so that my user model accesses a different table depending on which organisation the user is from. The session is set just before i call the auth attempt function and i know for a fact it contains a value at the time it's used. I have no idea why i get a syntax error here, it all looks fine to me(syntax wise).

I have this in my user model

public $table = Session::get('council').'_data';

and I get this error:

Symfony \ Component \ Debug \ Exception \ FatalErrorException

syntax error, unexpected '(', expecting ',' or ';'

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.

© 2025 Laravel.io - All rights reserved.