第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

Laravel-未根據(jù)要求設(shè)置會(huì)話存儲(chǔ)

Laravel-未根據(jù)要求設(shè)置會(huì)話存儲(chǔ)

PHP
牧羊人nacy 2019-12-25 15:37:49
我最近創(chuàng)建了一個(gè)新的Laravel項(xiàng)目,并遵循有關(guān)身份驗(yàn)證的指南。當(dāng)我訪問(wèn)登錄或注冊(cè)路線時(shí),出現(xiàn)以下錯(cuò)誤:ErrorException in Request.php line 775:Session store not set on request. (View: C:\Users\Matthew\Documents\test\resources\views\auth\register.blade.php)我還沒(méi)有編輯任何核心Laravel文件,我只創(chuàng)建了視圖并將路由添加到了route.php文件中// Authentication routesRoute::get('auth/login', ['uses' => 'Auth\AuthController@getLogin', 'as' => 'login']);Route::post('auth/login', ['uses' => 'Auth\AuthController@postLogin', 'as' => 'login']);Route::get('auth/logout', ['uses' => 'Auth\AuthController@getLogout', 'as' => 'logout']);// Registration routesRoute::get('auth/register', ['uses' => 'Auth\AuthController@getRegister', 'as' => 'register']);Route::post('auth/register', ['uses' => 'Auth\AuthController@postRegister', 'as' => 'login']);我在Laravel上沒(méi)有太多經(jīng)驗(yàn),所以請(qǐng)?jiān)徫业臒o(wú)知。我知道還有另一個(gè)問(wèn)題要問(wèn)同樣的事情,但似乎沒(méi)有一個(gè)答案對(duì)我有用。謝謝閱讀!編輯:這是我所要求的register.blade.php。@extends('partials.main')@section('title', 'Test | Register')@section('content')    <form method="POST" action="/auth/register">        {!! csrf_field() !!}        <div class="ui input">          <input type="text" name="name" value="{{ old('name') }}" placeholder="Username">        </div>        <div class="ui input">          <input type="email" name="email" value="{{ old('email') }}" placeholder="Email">        </div>        <div class="ui input">          <input type="password" name="password" placeholder="Password">        </div>        <div class="ui input">          <input type="password" name="password_confirmation"placeholder="Confirm Password">        </div>        <div>            <button class="ui primary button" type="submit">Register</button>        </div>    </form>@endsection
查看完整描述

3 回答

?
函數(shù)式編程

TA貢獻(xiàn)1807條經(jīng)驗(yàn) 獲得超9個(gè)贊

如果您需要會(huì)話狀態(tài),CSRF保護(hù)等等,則需要使用Web中間件。


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

    // your routes here

});


查看完整回答
反對(duì) 回復(fù) 2019-12-25
?
蝴蝶刀刀

TA貢獻(xiàn)1801條經(jīng)驗(yàn) 獲得超8個(gè)贊

就我而言(使用Laravel 5.3),僅添加以下2個(gè)中間件使我能夠訪問(wèn)API路由中的會(huì)話數(shù)據(jù):


\App\Http\Middleware\EncryptCookies::class

\Illuminate\Session\Middleware\StartSession::class

整個(gè)聲明($middlewareGroups在Kernel.php中):


'api' => [

            \App\Http\Middleware\EncryptCookies::class,

            \Illuminate\Session\Middleware\StartSession::class,

            'throttle:60,1',

            'bindings',

        ],


查看完整回答
反對(duì) 回復(fù) 2019-12-25
  • 3 回答
  • 0 關(guān)注
  • 460 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)