app/Http/Controllers/enroll_courseController.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)
    {
        $validatedData = $request->validate([
            'id_courses' => 'required',
            'course_name' => 'required',
            'id' => 'required'
        ]);
        enroll_course::create($validatedData);
        $request->session()->flash('success','Successfully Enroll the Course!');
        return redirect('/dashboard/enroll');
    }
public function store ( Request $ request ) { $ validatedData = $ request -> validate ( [ 'id_courses' => 'required' , 'course_name' => 'required' , 'id' => 'required' ] ) ; enroll_course :: create ( $ validatedData ) ; $ request -> session ( ) -> flash ( 'success' , 'Successfully Enroll the Course!' ) ; return redirect ( '/dashboard/enroll' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
//$validatedData['id'] = auth()->user()->id;