路由中出现致命错误异常


FatalErrorException in routes

我是这个PHP框架Laravel的初学者。。所以我遇到了这个问题,试着在几个小时内解决它,但没有成功。

routes.php第24行出现致命错误异常:语法错误,意外的"}"

我已经完成了所有的步骤,从youtube上的Mindspace课程中学习,https://www.youtube.com/watch?v=hJIc9lVTJj4&index=1&list=PL55RiY5tL51oloSGk5XdO2MGjPqc0BxGV#t=741.263237

(附言。我还建立了与数据库的连接,以及该教程中介绍的所有这些东西)

我的路线.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

和UserController.php

namespace App'Http'Controllers;
use Illuminate'Http'Request;
class UserController extends Controller
{
    public function postSignUp(Request $request)
    {
    $email = $request['email'];
    $first_name = $request['first_name'];
    $password = bcrypt($request['password']); 
    $user = new User();
    $user->email = $email;
    $user->first_name = $first_name;
    $user->password = $password;
    $user->save();
    return redirect()->back();
    }
    public function postSignIn(Request $request)
    {
    }
}

以及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
});