I am trying to add multiple column and when submitting the data then it's showing error like:
Argument 1 passed to Illuminate\Database\Grammar::parameterize() must be of the type array, null given, called in C:\xampp\htdocs\CERCAA\vendor\laravel\framewo
Here is controller:
-
public function store(Request $request) {
$data = new past_events(); $data->title = $request->title; $data->slug = $request->slug; $data->event_date = $request->event_date; $data->event_video_link = $request->event_video_link; $data->event_place_name = $request->event_place_name; $data->category_id = $request->category_id; $data->save(); $id = $data->id; // foreign_key foreach ($request->Featured as $key=>$file){ $speaker=new past_event_speaker(); $speaker->past_event_id = $id; $speaker->Featured = $request->Featured[$key]; $speaker->speaker_name = $request->speaker_name[$key]; $speaker->speaker_position = $request->speaker_position[$key]; $speaker->save(); } foreach ($request->Featured1 as $key=>$file){ $session = new past_event_session(); $session->past_event_id = $id; $session->Featured1 = $request->Featured1[$key]; $session->session_time = $request->session_time[$key]; $session->event_session_name = $request- >event_session_name[$key]; $session->session_person_name = $request- >session_person_name[$key]; $session->session_person_topic = $request- >session_person_topic[$key]; $session->File =$request->File[$key]; $session->save(); } }
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire