Php 路由中的FatalErrorException
我是这个PHP框架的乞丐,Laravel。。所以我遇到了这个问题,试图在几个小时内解决它,但没有效果 routes.php第24行中的FatalErrorException: 语法错误,意外“}” 在这里之前,我已经完成了所有步骤,从youtube上的Mindspace课程中学习 (顺便说一句,我还建立了与数据库的连接,以及该教程中介绍的所有内容) my routes.phpPhp 路由中的FatalErrorException,php,laravel-5,laravel-routing,Php,Laravel 5,Laravel Routing,我是这个PHP框架的乞丐,Laravel。。所以我遇到了这个问题,试图在几个小时内解决它,但没有效果 routes.php第24行中的FatalErrorException: 语法错误,意外“}” 在这里之前,我已经完成了所有步骤,从youtube上的Mindspace课程中学习 (顺便说一句,我还建立了与数据库的连接,以及该教程中介绍的所有内容) my routes.php <?php /* |---------------------------------------------
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web']], function() {
Route::get('/', function () {
return view('welcome');
});
Route::post('/signup', [
'uses' => 'UserController@postSignUp',
'as' => 'signup'
])
}); ---- line 24 is here
还有welcome.blade.php
<div class="col-md-6">
<h3>Sign Up</h3>
<form action="{{ route('signup') }}" method="post">
<div class="form-group">
<label for="email">Your E-Mail</label>
<input class="form-control" type="text" name="email" id="email">
</div>
<div class="form-group">
<label for="first_name">Your First Name</label>
<input class="form-control" type="text" name="first_name" id="first_name">
</div>
<div class="form-group">
<label for="password">Your Password</label>
<input class="form-control" type="password" name="password" id="password">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
<input type="hidden" name="_token" value = "{{ Session::token() }}">
</form>
</div>
注册
你的电子邮件
你的名字
你的密码
提交
您遗漏了分号:
// ...
Route::post('/signup', [
'uses' => 'UserController@postSignUp',
'as' => 'signup'
]); // <<=== HERE
});
/。。。
路线::post(“/signup”[
'使用'=>'UserController@postSignUp',
'作为'=>'注册'
]); // 你漏掉了一个分号:
// ...
Route::post('/signup', [
'uses' => 'UserController@postSignUp',
'as' => 'signup'
]); // <<=== HERE
});
/。。。
路线::post(“/signup”[
'使用'=>'UserController@postSignUp',
'作为'=>'注册'
]); // 您已经显示了11行Routes.php
和一条关于行号30的错误消息???不太有帮助。显示所有的路由。php
或者我们所能做的就是猜测我现在已经更改了。抱歉误解了。您已经显示了11行Routes.php
和一条关于行号30的错误消息???不太有帮助。显示所有的路由。php
或者我们所能做的就是猜测我现在已经更改了。对不起,我误解了。哦,我的上帝。。。非常感谢你的评论。这个分号花了我大约1,5个小时…天啊。。。非常感谢你的评论。这个分号花了我大约1,5个小时。。。