dongxun5349 2015-12-03 07:49
浏览 162

如何解决此解析错误:“语法错误,意外'为'(T_AS)”?

When I run command php artisan serve, I got this error:

local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'syntax error, unexpected 'as' (T_AS)' in D:\xampp\htdocs\laravel\vendor\laravel\framework\src\Illuminate\Http\Request.php‌​:705 Stack trace: #0 {main}

Route::group(['prefix' => 'admin'], function() {

    Route::get('/', [ 'as' => 'admin.login', 'uses' => 'Admin\AuthController@getLogin' ]);
    Route::post('/login', [ 'as' => 'admin.checkLogin', 'uses' => 'Admin\AuthController@checkLogin' ]);
    Route::get('/logout', [ 'as' => 'admin.logout', 'uses' => 'Admin\AuthController@getLogout' ]);

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

        Route::get('/dashboard', function(){
            return view('admin::user.dashboard');
        });

        Route::get('/users', [ 'as' => 'user.index', 'uses' => 'UserController@index' ]);

    });
});
  • 写回答

1条回答 默认 最新

  • dongtuo3530 2015-12-03 07:54
    关注

    There is an error in your code (possibly not related at all with artisan). Question is many people get an error when running an artisan command, and they think the error is related to artisan. Fact is artisan won't run well when you have some particular errors in your code.

    As artisan won't show the full stack error, you must check the logs as @chanafdo suggested. Check the last error stack in the most recent file in the directory storage\logs.

    评论

报告相同问题?

悬赏问题

  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单