mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 00:11:27 -08:00
Allow settings to be overridden in request
This commit is contained in:
parent
48fb4f2439
commit
36210f1c6a
|
@ -61,9 +61,17 @@ class LabelsController extends Controller
|
||||||
$testAsset->model->category->id = 999999;
|
$testAsset->model->category->id = 999999;
|
||||||
$testAsset->model->category->name = 'Test Category';
|
$testAsset->model->category->name = 'Test Category';
|
||||||
|
|
||||||
|
$settings = Setting::getSettings();
|
||||||
|
if (request()->has('settings')) {
|
||||||
|
$overrides = request()->get('settings');
|
||||||
|
foreach ($overrides as $key => $value) {
|
||||||
|
$settings->$key = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (new LabelView())
|
return (new LabelView())
|
||||||
->with('assets', collect([$testAsset]))
|
->with('assets', collect([$testAsset]))
|
||||||
->with('settings', Setting::getSettings())
|
->with('settings', $settings)
|
||||||
->with('template', $template)
|
->with('template', $template)
|
||||||
->with('bulkedit', false)
|
->with('bulkedit', false)
|
||||||
->with('count', 0);
|
->with('count', 0);
|
||||||
|
|
Loading…
Reference in a new issue