我有一个在我的Laravel应用程序中执行路由API的Shell脚本。但是,当它执行它时,我有来自Token的错误。
尝试获取非对象的属性 在VerifyCsrfToken.php(第156行)
路线是http://localhost:8000/api/soap。 在SoapController中,我重定向到应用程序内的其他路径:
return redirect('/control_fich/'.$id_user.'/'.$date_utc);
路线是:
Route::get('control_fich/{id}/{date}','ControlFichController@index');
我把这条路线用作中间件VerifyCsrfToken.php
的除外 namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
class VerifyCsrfToken extends BaseVerifier
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'dropdown',
'control_fich/*',
];
}
但错误仍在继续。我需要做什么才能从API控制器执行内部控制器?
由于
答案 0 :(得分:1)