I have been trying to make a simple gambling website where players face each other to a coin toss. Whoever picks heads or tails wins the Bitcoin. I have the following routes file;
'''<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', 'PagesController@index');
Route::resource('games', 'GamesController');
Route::Controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\Passwordcontroller'
]);'''
and this is my GamesController:
'''<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
class GamesController extends Controller
{
/**
* create new instance of the game controller
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* show all games pending a partner
*/
public function index()
{
return 'The following users are ready to play';
}
/**
* Show a page to create new game
*/
public function create()
{
// create a new game
// load view to create game
return view('pages.create');
}
public function show()
{
// determine weather the outcome is heads or tails
return App\Games::all();
}
}'''
I am still fairly new to the laravel framework and any help I get is greatly appreciated. i've been at this all morning and can't find a solution.