N
N
nickname68472019-09-17 16:54:40
Laravel
nickname6847, 2019-09-17 16:54:40

How to bulk change data?

I have settings in the admin panel like this:
5d80e42c10fc9369937489.png
How do I change these settings by accessing the key value, which should match name?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
2
2vtlk, 2019-09-18
@nickname6847

If the question is still about Laravel, then:

$setting = Setting::whereKey('title')->first(); // выбираем какую то настройку из базы
$setting->value = 'Магазин по продаже носков'; // устанавливаем значение
$setting->save(); // сохраняем в БД

Naturally, you need to create a model that will be tied to this table

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question