You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.1 KiB

2 years ago
<?php
namespace App\Http\Controllers;
use App\Models\Game;
use Illuminate\Http\Request;
class GameController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
$games = Game::orderBy('id', 'desc')->get()->toArray();
return response()->json(['games' => $games], 200);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
// $game = Game::created($request);
// return response()->json(['ressult' => $game->toArray()], 200);
}
/**
* Display the specified resource.
*/
public function show(string $id)
{
$game = Game::findOrFail($id)->toArray();
return response()->json(['game' => $game], 200);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy(string $id)
{
//
}
}