app/Http/Controllers/ScheduleController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        $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::create($schedule_data);
        return redirect()->back()->with('success', 'Your schedule has been created');
    }
public function store ( Request $ request ) { $ 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 :: create ( $ schedule_data ) ; return redirect ( ) -> back ( ) -> with ( 'success' , 'Your schedule has been created' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .