Worked it out, need to use a constructer.
REF: http://stackoverflow.com/questions/20787621/use-session-in-eloquent-laravel
protected $connection = 'default';
public function __construct() {
parent::__construct();
$this->connection = Session::get("location");
}
Next I'm going to incorporate something so the database names aren't recorded in plain text.
Thanks, Zac
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community