我有點新來laravel,並遇到了一些我不知道如何解決,甚至從哪裏開始尋找。任何人都可以解釋這一點嗎?laravel artisan錯誤列出路線時
當我運行php artisan route:list
我得到:
[Symfony\Component\Debug\Exception\FatalErrorException]
syntax error, unexpected ','
我只是做了一些改動,以routes.php文件。自從評論出來並清除了緩存後,這仍然表明,無論如何。
更新 - routes.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.
|
*/
/**
* Blade adjustments to make it work with Angular.js
*/
Blade::setContentTags('<%', '%>'); // for variables and all things Blade
Blade::setEscapedContentTags('<%%', '%%>'); // for escaped data
/**
* Send requests to Angular.js (may need rethinking eventually because this is
* essentially a whitelist)
*/
Route::get('/{page?}', function($name = 'dash') {
return View::make('index');
})->where('page', '(dash|todo|help|settings)');
// Commented out to make Angular.js pages work
//Route::get('/', '[email protected]');
//Route::get('home', '[email protected]');
/**
* Page View Routes
* Author: Anthony Sinclair
* Date: 31/03/2015
*/
/** User GET for new Users created via the UI */
Route::get('user/new', '[email protected]');
/** User POST for catching Users created via the UI */
Route::post('user/new', '[email protected]');
/**
* RESTful API routes
* Author: Anthony Sinclair
* Date: 30/03/2015
*/
Route::group(array('prefix' => 'api/v1', 'before'=>'auth'), function(){
/** User based API call routing */
Route::resource('user', 'UserController');
/** People based API call routing */
Route::resource('recipient', 'PeopleController');
/** Survey based API call routing */
Route::resource('survey', 'SurveyController');
/** Survey Response based API call routing */
Route::resource('response', 'SurveyResponseController');
Route::resource('response/token/{survey_token}', '[email protected]');
/** Survey Instigator - The sending of Surveys */
Route::resource('send/{survey_id}', '[email protected]');
});
/** Nps based API call routing */
Route::get('/api/v1/nps/{survey_id}', '[email protected]');
Route::get('/api/v1/nps/{survey_id}/{filter}', '[email protected]');
Route::get('/api/v1/nps/{survey_id}/{filter}/{modifier}', '[email protected]');
Route::get('/api/v1/nps/response/{survey_id}/{recipient_id}/{nps_score}', '[email protected]');
Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController'
]);
即使檢查我的routes.php文件的內容 - 未顯示任何錯誤:
php -l app\http\routes.php
No syntax errors detected in app\http\routes.php
你的route.php中有什麼? –
@sgt - 更新我的問題與routes.php內容 – LokiSinclair
錯誤發生在哪裏?例外中應該提到文件和行號。 – lukasgeiter