2016-11-23 2 views

ответ

0
for ($e = 1; $e <= 10; $e++) 
{ 
    $edd = Setting::where('id', '=', $e)->update([ 
     'nama' => $request->{"nama$e"}, 
     'isi' => $request->{"isi$e"}, 
    ]); 
} 

Для получения дополнительной читаемости, вы можете сделать это:

$request->{"nama{$e}"} // Notice the inner braces around $e 
Смежные вопросы