jinglebird
jinglebird

Reputation: 578

web middleware laravel 5.2

I'm trying to use the middleware web, but when I put my route inside it, my project stop working and shows this error

Whoops, looks like something went wrong.

When I remove and use my route outside the middleware web, works again. What could be? (Sorry for my english, it is not my native language).

This works:

Route::get('/contact', 'TicketsController@create');
Route::post('/contact', 'TicketsController@store');

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

});

This not works:

Route::group(['middleware' => ['web']], function () {
    Route::get('/contact', 'TicketsController@create');
    Route::post('/contact', 'TicketsController@store');
});

Upvotes: 1

Views: 398

Answers (1)

jinglebird
jinglebird

Reputation: 578

I found how to solve this

  1. you must generate a key with php artisan key:generate
  2. In config/app.php place generate key' => 'xxxxxxxxxxxxxxxxxx',

I set true debug property in config/app.php ('debug' => env('APP_DEBUG', true) ) and i see how to fix that

Upvotes: 1

Related Questions