app/Http/Controllers/ScheduleController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, Schedule $schedule)
    {
         $request->validate([
            'course_id'     => 'required',
            'hall_id'       => 'required',
            'duration'      => 'required',
            'occurence'     => 'required',
        ]);
        $schedule_data = [
            'course_id'     => $request->course_id,
            'hall_id'       => $request->hall_id,
            'occurence'     => $request->occurence,
            'duration'      => $request->duration,
        ];
        $schedule->update($schedule_data);
        return redirect()->route('schedule.showlist')->with('success', 'Your schedule has been updated');
    }
public function update ( Request $ request , Schedule $ schedule ) { $ request -> validate ( [ 'course_id' => 'required' , 'hall_id' => 'required' , 'duration' => 'required' , 'occurence' => 'required' , ] ) ; $ schedule_data = [ 'course_id' => $ request -> course_id , 'hall_id' => $ request -> hall_id , 'occurence' => $ request -> occurence , 'duration' => $ request -> duration , ] ; $ schedule -> update ( $ schedule_data ) ; return redirect ( ) -> route ( 'schedule.showlist' ) -> with ( 'success' , 'Your schedule has been updated' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .