app/Http/Controllers/Admin/ExerciseController.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)
    {
        $this->validate($request, [
            'body_part_id' => 'required',
            'category_id' => 'required',
            'exercise_name' => 'required'
        ]);
        Exercise::create([
            'body_part_id' => $request->body_part_id,
            'category_id' => $request->category_id,
            'exercise_name' => $request->exercise_name
        ]);
        return redirect('/admin/exercises');
    }
public function store ( Request $ request ) { $ this -> validate ( $ request , [ 'body_part_id' => 'required' , 'category_id' => 'required' , 'exercise_name' => 'required' ] ) ; Exercise :: create ( [ 'body_part_id' => $ request -> body_part_id , 'category_id' => $ request -> category_id , 'exercise_name' => $ request -> exercise_name ] ) ; return redirect ( '/admin/exercises' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .