-2

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' ]);

    });
});
Gurpreet Singh
  • 3,061
  • 5
  • 19
  • 36
  • 1
    Please see [ask] and http://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/ ; Also show us the code, which gives you this error. – Rizier123 Dec 03 '15 at 07:50
  • you have to add your code... – Niranjan N Raju Dec 03 '15 at 07:54
  • Check the Laravel log file to get more info related to that error. You can find where to look for (a file and a line number) – chanafdo Dec 03 '15 at 08:06
  • 1
    Possible duplicate of [PHP Parse/Syntax Errors; and How to solve them?](http://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them) – D4V1D Dec 03 '15 at 08:12
  • [2015-12-03 08:03:48] 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} @chanafdo – Gurpreet Singh Dec 03 '15 at 08:55
  • Can you show the rest of that stack trace. – chanafdo Dec 03 '15 at 10:33

1 Answers1

1

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.

Amarnasan
  • 14,939
  • 5
  • 33
  • 37
  • 1
    This is more a comment rather than an answer. – Rizier123 Dec 03 '15 at 07:56
  • @Rizier123 Indeed. And this comment is as much comment as your comment. – Amarnasan Dec 03 '15 at 07:59
  • [2015-12-03 08:03:48] 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} – Gurpreet Singh Dec 03 '15 at 08:55
  • @GurpreetSingh You really should include the _full_ stack error in your question. – Amarnasan Dec 03 '15 at 08:57