草庐IT

AUTH_FAILED

全部标签

php - Laravel 5:如何在路由中使用 Auth::user()->id

我尝试使用phpLaravel框架创建一个应用程序。当我在我的路由文件中使用Auth::user()->id时>我收到错误消息“尝试获取非对象的属性”。那么我该如何解决呢?这是我的路由文件`'Auth\AuthController','password'=>'Auth\PasswordController',]);$common_variable=App\MyModel::where('site_id',Auth::user()->id)->count();view()->share(compact('common_variable'));` 最佳答案

php - Laravel 5.2 - 使用 Auth::check() 在 MIddleware 中不起作用

我正在尝试在我的Laravel5.2应用程序中为不同类型的用户制作一个中间件。所以,我正在做的是为不同的用户制作不同的中间件。据我所知,如果不使用来自here的中间件网络,Auth::check()将无法工作。.所以,我所做的是-routes.phpRoute::group(['middleware'=>['web','admin']],function(){//suspend,activate,deleteRoute::get('users',['uses'=>'AdminController@users','as'=>'users']);//Edit,activate,suspen

php - 流明:jwt-auth 不存在方法句柄,已完成中间件

嘿,所以我刚刚更新到Lumen5.2并遇到了jwt-auth的问题。我已按照所有说明更新了我的app.php文件,包括所有中间件。我还Composer需要照明/路由和照明/授权。但是我得到了错误:Macroable.php第81行中的BadMethodCallException:方法句柄不存在。在Macroable.php第81行的ResponseFactory->__call('handle',array(object(Request),object(Closure)))我似乎无法从那个错误中得到任何意义?这是我的boostrap/app.php供引用:load();}catch(D

php - Firebase 云消息传递 HTTP V1 API : How to Get the Auth 2. 0 访问 token 与 REST 调用?

为了在PHP中使用HTTPV1API(不是遗留API),必须使用REST接口(interface)。https://firebase.google.com/docs/cloud-messaging/send-message#top_of_page我想知道如何获得Auth2.0访问token?https://firebase.google.com/docs/cloud-messaging/auth-server由于没有适用于PHP的GoogleAPI客户端库(请参阅上面链接中的示例),如何通过REST调用接收Auth2.0token(无需显示PHP代码)?相关问题:一旦收到这个短命tok

php - mssql_execute 失败, "stored procedure execution failed"

我目前正在使用以下查询成功连接到位于Windows2008上的SQL数据库;$result=mssql_query("EXECdbo.stored_procedure_name@param_level=2");我的查询基于用VB/ADO编写的现有代码,看起来像;Iflevel=""Thenlevel=1cmdTT.ActiveConnection=connStrTest1setobjParam=cmdTT.CreateParameter("@param_level",adInteger,adParamInput,4,level)cmdTT.Parameters.AppendobjPar

php - 验证码 file_get_contents() : SSL operation failed

我正在为我的网页使用GooglereCaptcha。在测试模式下一切正常。无SSL。当我在生产环境中测试我的网页时,出现以下错误:Warning:file_get_contents():SSLoperationfailedwithcode1.OpenSSLErrormessages:error:14090086:SSLroutines:SSL3_GET_SERVER_CERTIFICATE:certificateverifyfailedin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Post.phponline68Warni

PHP 警告 : require_once(/var/www/html/wp-config. php) : failed to open stream: Permission denied in/var/www/html/wp-load. php on line 37

我正在apache上创建一个Wordpress应用程序服务器,在访问url时收到错误500。因此,我确实检查了httpd/logs/error_log,以下是错误[SunJan1522:42:54.4403492017][:error][pid767][client10.203.116.148:9173]PHPWarning:require_once(/var/www/html/wp-config.php):failedtoopenstream:Permissiondeniedin/var/www/html/wp-load.phponline37[SunJan1522:42:54.44

php - Firebase Auth -> 使用 signInWithCustomToken 创建的用户没有电子邮件地址

我正在为使用Ionic制作的移动应用程序使用Firebase自定义身份验证系统,并且我使用Laravel5.2作为自定义身份验证后端。当新用户注册时,我在laravel中生成一个token(使用firebase/php-jwt)并将其返回到移动应用程序。在此注册过程中,应用程序接收token并使用以下代码在firebase上创建用户:firebase.auth().signInWithCustomToken($auth.getToken()).then(function(response){$log.debug(response);}).catch(function(error){$l

php - file_put_contents(.../bootstrap/cache/services.json) : failed to open stream: No such file or directory

我在运行任何phpartisan命令时一直收到此错误。[ErrorException]file_put_contents(/Applications/MAMP/htdocs/code/bheng/md-bheng/bootstrap/cache/services.json):failedtoopenstream:Nosuchfileordirectory我该如何阻止它? 最佳答案 编辑-如果services.json文件不存在,运行phpartisanserve然后停止强制创建文件。请参阅:laravelservices.jsonn

php - Laravel: Trait method guard 没有被应用,因为与 App\Http\Controllers\Auth\AuthController 上的其他 trait 方法有冲突

我正在更新到Laravel5.4并收到此错误消息:Traitmethodguardhasnotbeenapplied,becausetherearecollisionswithothertraitmethodsonApp\Http\Controllers\Auth\AuthController这是我的AuthController类。middleware($this->guestMiddleware(),['except'=>['getLogout']]);}/***Getavalidatorforanincomingregistrationrequest.**@paramarray$d