app/Http/Controllers/PersonController.php
/**
     * Store a newly created resource in storage.
     *
     * @param Person $person
     * @param StoreRequest $request
     * @return PersonResource
     */
Store a newly created resource in storage.
@param Person $person
@param StoreRequest $request
@return PersonResource
Store a newly created resource in storage . @param Person $person @param StoreRequest $request @return PersonResource
public function store(Person $person, StoreRequest $request)
    {
        $p = $person->create(
            [
                'name' => $request->input('name'),
                'height' => $request->input('height'),
                'weight' => $request->input('weight'),
            ]
        );
        return new PersonResource($p);
    }
public function store ( Person $ person , StoreRequest $ request ) { $ p = $ person -> create ( [ 'name' => $ request -> input ( 'name' ) , 'height' => $ request -> input ( 'height' ) , 'weight' => $ request -> input ( 'weight' ) , ] ) ; return new PersonResource ( $ p ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .