drf97973 2016-01-18 06:45
浏览 50
已采纳

Laravel make:auth问题,无法查看premade登录或注册页面

I've created a laravel 5.2 project. I added a database, and some basic views and controllers (Note: I think this is my problem). I then ran the artisan make:auth command. It ran successfully. Despite me already having a login and home view and controller.

I can view laravel's premade 'home' page on my localhost. But once I click the login or register link, things break and I get,

"No supported encrypter found. The cipher and / or key length are invalid."

I've de-bugged this and insured my keys are correct and in the appropriate places.

This is my routes.php

Route::get('/', function () {
    return view('welcome');
});

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

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

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

I obviously have no route here for login or register, but shouldn't make:auth create routing behind the scenes? From what I've read, this should have worked out of the box. What am I missing here? Any help would be great,

Thanks.

  • 写回答

2条回答 默认 最新

  • dsubq24666 2016-01-18 23:40
    关注

    I have resolved my problem.

    I had originally set the key in my .env file to

    APP_KEY=854uQ9...(random 32 bit key)

    I had also set config/app.php to

    'key' => env('854uQ9...(same 32 bit key as above)')
    

    NOTE the missing ''APP_KEY''. Once I changed config/app.php back to

    'key' => env('APP_KEY', 'SomeRandomString'),
    

    the links worked. I can now change 'SomeRandomString' to my app key, but as the .env file is checked first, I assume this can be left as is.

    Thanks for the replys.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题