0

Hey everybody I am creating an e-commerce site that sells digital items. It's my first Laravel application. Initially, I couldn't even load the login or registration pages until running php artisan make:auth, which created a bunch of views and edited my routes file. I get the sign up form now, but I get a "Session store not set on request." error upon submission. I had a look at this question, but after adding my auth routes, I get a "Session store not set on request." error. Here is the 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.
|
*/
/*
|--------------------------------------------------------------------------
| 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('/', function() {
    return view('welcome');
});
Route::post('/item/create', ['as' => 'item.store', 'uses' => 'ItemController@store']);
Route::resource('item', 'ItemController');


Route::group(['middleware' => ['web']], function(){

    Route::get('/register', 'Auth\AuthController@getRegister');
    Route::post('/register', 'Auth\AuthController@postRegister');


    Route::auth();
    Route::get('/checkout', function() {
        return view('cart.checkout');
    });



    Route::get('/home', 'HomeController@index');
    Route::post('/item', 'ItemController@store');
    Route::get('/item', 'ItemController@index');
    Route::get('/item/{id}', 'ItemController@show');
    Route::get('/addItem/{productID}', 'CartController@addItem');
    Route::get('/removeItem/{productID}', 'CartController@removeItem');

});         


//Route









    Route::post('/create_payment', function(){
// Set your secret key: remember to change this to your live secret key in production
// See your keys here https://dashboard.stripe.com/account/apikeys
        \Stripe\Stripe::setApiKey("sk_test_VVSBY8xjNklioi7V0yFVfx6Q");

        $receiver = \Stripe\BitcoinReceiver::create(array(
            "amount" => 1000,    // amount in cents
            "currency" => "usd", // presently can only be USD
            "email" => "payinguser+fill_now@example.com"
        ));

        $charge = \Stripe\Charge::create(array(
            "amount" => $receiver->amount,
            "currency" => $receiver->currency,
            "source" => $receiver->id,
            "description" => "Example charge"
        ));
        Route::controllers([
            'auth' => 'Auth\AuthController',
            'password' => 'Auth\PasswordController'
        ]);
    });


    Route::get('/logout', 'Auth\AuthController@getLogout');

// Registration routes...


Route::get('/home', 'HomeController@index');

Any help would be greatly appreciated!

Community
  • 1
  • 1
Tom Morison
  • 564
  • 1
  • 8
  • 26

1 Answers1

2

First create a controller. php artisan make:controller UserController. In your UserController create a function to show to login page public function getLogin(){ return view (login)} after that in your routes.php create a Route method. Route::get('/login', 'UserController@getLogin')

Francisunoxx
  • 1,440
  • 3
  • 22
  • 45