| Total Complexity | 6 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class GamesController extends AuthController |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * The GameRepository instance. |
||
| 14 | * |
||
| 15 | * @var \Gameap\Repositories\GameRepository |
||
| 16 | */ |
||
| 17 | public $repository; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * GamesController constructor. |
||
| 21 | * @param GameRepository $repository |
||
| 22 | */ |
||
| 23 | public function __construct(GameRepository $repository) |
||
| 24 | { |
||
| 25 | parent::__construct(); |
||
| 26 | |||
| 27 | $this->repository = $repository; |
||
| 28 | } |
||
| 29 | |||
| 30 | public function index() |
||
| 31 | { |
||
| 32 | $games = Game::all(); |
||
| 33 | |||
| 34 | return response()->json($games); |
||
| 35 | } |
||
| 36 | |||
| 37 | public function store(Request $request) |
||
| 38 | { |
||
| 39 | $game = Game::create($request->all()); |
||
| 40 | |||
| 41 | return response()->json($game, 201); |
||
| 42 | } |
||
| 43 | |||
| 44 | public function show(Game $game) |
||
| 45 | { |
||
| 46 | return response()->json($game); |
||
| 47 | } |
||
| 48 | |||
| 49 | public function update(Request $request, Game $game) |
||
| 54 | } |
||
| 55 | |||
| 56 | public function destroy(Game $game) |
||
| 61 | } |
||
| 62 | } |
||
| 63 |