app/Http/Controllers/PlayersController.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 )
    {
        $first_name      = $request->input('firstName', false);
        $last_name       = $request->input('lastName', false);
        $height          = $request->input('height', false);
        $weight          = $request->input('weight', false);
        $jersey_number   = $request->input('jerseyNumber', false);
        $player_position = $request->input('playerPosition', false);
        $player_image    = $request->input('playerImage', false);
        $player = new Player;
        $player->first_name      = $first_name;
        $player->last_name       = $last_name;
        $player->height          = $height;
        $player->weight          = $weight;
        $player->jersey_number   = $jersey_number;
        $player->player_position = $player_position;
        $player->player_image    = $player_image;
        $player->save();
        $id = $player->id;
        return \redirect("/project-1/players/$id");
    }
public function store ( Request $ request ) { $ first_name = $ request -> input ( 'firstName' , false ) ; $ last_name = $ request -> input ( 'lastName' , false ) ; $ height = $ request -> input ( 'height' , false ) ; $ weight = $ request -> input ( 'weight' , false ) ; $ jersey_number = $ request -> input ( 'jerseyNumber' , false ) ; $ player_position = $ request -> input ( 'playerPosition' , false ) ; $ player_image = $ request -> input ( 'playerImage' , false ) ; $ player = new Player ; $ player -> first_name = $ first_name ; $ player -> last_name = $ last_name ; $ player -> height = $ height ; $ player -> weight = $ weight ; $ player -> jersey_number = $ jersey_number ; $ player -> player_position = $ player_position ; $ player -> player_image = $ player_image ; $ player -> save ( ) ; $ id = $ player -> id ; return \ redirect ( " /project-1/players/ $ id " ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .