This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Apache46
How can I change the connection of the backend user model or of generic model? I have tried these ways but it doesn't work.
use Backend\Models\User;
...and in boot method of my plugin
1. User::extend(function($model) { $model->setConnection('master'); });
2. User::extend(function($model) { $model->addDynamicProperty('connection', 'master'); });
3. User::extend(function($model) { $model->connection = 'master'; });
4. User::extend(function($model) { $model['connection'] = 'master'; });
1-2 of 2