app/Http/Controllers/PlayerController.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)
    {
        $player = new Player();
        $player->id = $request->id;
        $player->event_id = $request->event_id;
        $player->name = $request->name;
        $player->save();
        return new PlayerResource($player);
    }
public function store ( Request $ request ) { $ player = new Player ( ) ; $ player -> id = $ request -> id ; $ player -> event_id = $ request -> event_id ; $ player -> name = $ request -> name ; $ player -> save ( ) ; return new PlayerResource ( $ player ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .