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" => "[email protected]"
        ));

        $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!

2
  • what version of 5.2? Commented Jun 8, 2016 at 0:27
  • Creating php artisan make:auth will set your laravel to default structure of your folder. Commented Jun 8, 2016 at 0:27

1 Answer 1

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')

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.