无法使用Visual Code在Laravel项目中进行调试 [英] Can't using Visual Code to debug in Laravel project

查看:216
本文介绍了无法使用Visual Code在Laravel项目中进行调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VSCode上用PHP调试时配置成功.

I was config success to debug in PHP on VSCode.

我的问题是,当我运行项目时,它总是在函数上出错:

My problem is when I run the project it always errors at the function:

protected function getJsonPayload($payload)
{
    $payload = json_decode(base64_decode($payload), true);

    // If the payload is not valid JSON or does not have the proper keys set we will
    // assume it is invalid and bail out of the routine since we will not be able
    // to decrypt the given value. We'll also check the MAC for this encryption.
    if (! $this->validPayload($payload)) {
        throw new DecryptException('The payload is invalid.');
    }

    if (! $this->validMac($payload)) {
        throw new DecryptException('The MAC is invalid.');
    }

    return $payload;
}

...来自文件:/srv/http/laravelproject/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php

我无法调试到设置的断点.

I can't debug to breakpoint I was set.

Gif屏幕记录: http://i.imgur.com/6pNkoHe.gif

推荐答案

您的问题似乎与

Your question seems to be a related post to this, which provides a pretty good answer. Also, my question to you is why are you using DecryptException? Laravel has bcrypt(for password hashing) and csrf tokens (form data encryption) that are much easier to use.

对于那些在不阅读评论的情况下寻求快速解答的人:

For those looking for a quick answer without reading the comments:

在Eloquent中运行这些命令:

Run these commands in Eloquent:

php artisan optimize-> php artisan cache:clear-> composer dump-autoload

这篇关于无法使用Visual Code在Laravel项目中进行调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆