use Cubist\Backpack\Magic\Fields\Textarea;
use Cubist\Backpack\Magic\Models\CubistMagicAuthenticatable;
use Illuminate\Database\Eloquent\Builder;
+use Illuminate\Support\Arr;
class User extends CubistMagicAuthenticatable
{
'read_only' => true]);
$this->addField(['name' => 'toolbox_settings',
- 'type' => Hidden::class]);
+ 'type' => Hidden::class, 'default' => '{}', 'cast' => 'json']);
$extranetv1 = ['settings', 'ws_password', 'ws_settings', 'ws_rights', 'ws_domains', 'ws_count', 'login', 'mobile', 'fax', 'notes', 'resetpassword'];
$builder->whereIn('id', Permissions::getManagedUsers($bu->id));
}
+ public function getToolboxSetting($key)
+ {
+ return Arr::get($this->getAttribute('toolbox_settings'), $key);
+ }
}