Closed buglinjo closed 4 years ago
Please provide your actual relationship with the database connection of each model.
Figured it out with setting table name inside the model.
/**
* @var string
*/
protected $connection = 'con1';
/**
* Model constructor.
*
* @param array $attributes
*/
public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$this->table = DB::connection($this->getConnectionName())->getDatabaseName() . '.' . $this->getTable();
}
Thank you! Great package!
The model I'm trying to get has a different connection than the model I'm referring from.
Please add functionality which will enable us to select connection per model in the array.