0
我遇到這個錯誤時遇到了困難,我的解決方案是創建新的項目。我知道這個問題一直在問這裏。我一行一行地跟着所有的教程,總是出錯。Laravel NotFoundHttpException RouteCollection.php 161行:
報名方式:
@extends('layouts.master')
@section('content')
<div class="col-md-6">
<form method="POST" action="{{ route('signup') }}">
<div class="form-group">
<input type="text" name="username" placeholder="Username" class="form-control"></input>
</div>
<div class="form-group">
<input type="password" name="password" placeholder="Password" class="form-control"></input>
</div>
<div class="form-group">
<input type="submit" value="Submit" class="btn btn-primary pull-right"></input>
<input type="hidden" name="_token" value="{{ Session::token() }}"></input>
</div>
</form>
</div>
@endsection
routes.php文件
<?php
Route::get('/', function() {
return view('welcome');
});
Route::post('/signup', [
'uses' => '[email protected]',
'as' => 'signup'
]);
UserController的
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\User;
class UserController extends Controller
{
public function postSignUp(Request $request){
$username = $request['username'];
$password = bcrypt($request['password']);
$user = new User();
$user->username = $username;
$user->password = $password;
$user->save();
return redirect()->back();
}
}
我真的回來了重定向() - >回(),但仍錯誤 –
能否請您添加一個'得到Route'在我的答案給出,讓我知道什麼happends – VipindasKS
是的,我確實還是同樣的錯誤,先生 –