2017-03-04 5 views
1

私はマルチアサーションを作成しています。管理者のログインビューから管理者の電子メールとパスワードを送信するとエラーが発生する "Response.php行のUnexpectedValueException 444: レスポンスのコンテンツは、__toString()、" boolean "が指定された文字列またはオブジェクトでなければなりません。ここ は私のフォームLaravel 5.4フォームサブミットのResponse.php行444のUnexpectedValueException

@extends('layouts.app') 

@section('content') 
    <div class="container"> 
     <div class="row"> 
      <div class="col-md-8 col-md-offset-2"> 
       <div class="panel panel-default"> 
        <div class="panel-heading">Admin Login</div> 
        <div class="panel-body"> 
         <form class="form-horizontal" role="form" method="POST" action="{{ route('admin.login.submit') }}"> 
          {{ csrf_field() }} 

          <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}"> 
           <label for="email" class="col-md-4 control-label">E-Mail Address</label> 

           <div class="col-md-6"> 
            <input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required autofocus> 

            @if ($errors->has('email')) 
             <span class="help-block"> 
             <strong>{{ $errors->first('email') }}</strong> 
            </span> 
            @endif 
           </div> 
          </div> 

          <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}"> 
           <label for="password" class="col-md-4 control-label">Password</label> 

           <div class="col-md-6"> 
            <input id="password" type="password" class="form-control" name="password" required> 

            @if ($errors->has('password')) 
             <span class="help-block"> 
             <strong>{{ $errors->first('password') }}</strong> 
            </span> 
            @endif 
           </div> 
          </div> 

          <div class="form-group"> 
           <div class="col-md-6 col-md-offset-4"> 
            <div class="checkbox"> 
             <label> 
              <input type="checkbox" name="remember" {{ old('remember') ? 'checked' : '' }}> Remember Me 
             </label> 
            </div> 
           </div> 
          </div> 

          <div class="form-group"> 
           <div class="col-md-8 col-md-offset-4"> 
            <button type="submit" class="btn btn-primary"> 
             Login 
            </button> 

            <a class="btn btn-link" href="{{ route('password.request') }}"> 
             Forgot Your Password? 
            </a> 
           </div> 
          </div> 
         </form> 
        </div> 
       </div> 
      </div> 
     </div> 
    </div> 
@endsection 

そして、ここでは、ルート

Route::prefix('admin')->group(function(){ 
    Route::post('/login', 'Auth\[email protected]')->name('admin.login.submit'); 
}); 

され、コントローラは、ここに

<?php 

namespace App\Http\Controllers\Auth; 

use Illuminate\Http\Request; 
use App\Http\Controllers\Controller; 

class AdminLoginController extends Controller 
{ 
    public function __construct() 
    { 
     $this->middleware('guest'); 
    } 

    public function showLoginForm() 
    { 
     return view('admin.auth.login'); 
    } 
    public function login(Request $request) 
    { 
     return true; 
    } 
} 

ここで何が間違っているのですか? どうすれば解決できますか?

ありがとうございます。

答えて

2

この問題が見つかりました。それは私のコントローラにあった。ログイン機能とまったく同じです。私は真実をreturened。ここに問題があります。私が1を返すとき、それは働いた。