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