我正在使用 php artisan make:command test [例如我创建命令测试] 如果我想在函数句柄中使用 dd 如何检查终端到浏览器的错误
我尝试在句柄函数中使用 dd($user) ,当我使用 php artisan test 时,它会打印出正确的 $user
public function handle()
{
$user = User::all();
dd($user);
}
Run Code Online (Sandbox Code Playgroud)
但是我有很多 User 并且很难在终端中查看所有用户。他们无论如何要在终端中使用命令测试,我希望它在浏览器中产生结果而不创建新的控制器吗?
当我在注册页面输入内容时出现错误。错误说:
unknown local mutation type: setRegisterEmail, global type: authentication/setRegisterEmail
Run Code Online (Sandbox Code Playgroud)
我尝试了很多方法还是无法修复。
这是我的register.vue:
Import { mapState, mapMutations, mapActions } from 'vuex';
export default {
computed: {
...mapState('authentication', [
'registerEmail',
'registerPassword',
'registerError',
]),
},
methods: {
...mapMutations('authentication', [
'setRegisterEmail',
'setRegisterPassword',
]),
...mapActions('authentication', [
'register',
]),
},
};
Run Code Online (Sandbox Code Playgroud)
这是我的authentication.js:
export default {
namespaced: true,
state: {
registerEmail: null,
registerPassword: null,
registerError: null,
token: null,
},
mutation: {
setToken(state, token) {
state.token = token;
},
setRegisterEmail(state, email) {
state.registerEmail = email;
},
setRegisterPassword(state, password) { …Run Code Online (Sandbox Code Playgroud)