-2

How to insert an array to database in Laravel 5.6 Array in controller

public function insert(Request $request )
{
    $idsArry = $request->input('id'); 

    DB::table('work_user')->insert(array(['WorkID' => $idsArry]));

    return redirect ("/works_assign")->with("Success", "Deleted Successfully") ;
}
julianstark999
  • 3,450
  • 1
  • 27
  • 41
Test Check
  • 119
  • 11

1 Answers1

0
  $array = [
    'one' => $one,
    'two' => $two,
    'nine' => $nine,
    'ten' => $ten,
   ];

  YourModel::create($array)