
{
"errors": [
{
"message": "Validation failed for the field [onlineStoreThemeEditorSessionCreate].",
"extensions": {
"validation": {
"themeId": [
"The selected theme id is invalid."
]
},
"category": "validation"
},
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"onlineStoreThemeEditorSessionCreate"
],
"trace": ...
}
],
"data": {
"onlineStoreThemeEditorSessionCreate": null
}
}

{
"errors": [
{
"message": "Validation failed for the field [onlineStoreThemeEditorSessionCreate].",
"extensions": {
"validation": {
"themeId": [
"所选的theme id无效。"
]
},
"category": "validation"
},
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"onlineStoreThemeEditorSessionCreate"
],
"trace": ...
}
],
"data": {
"onlineStoreThemeEditorSessionCreate": null
}
}
extend type Mutation {
"创建主题编辑会话"
onlineStoreThemeEditorSessionCreate(themeId: ID! @rules(apply: ["exists:theme_asset,theme_id"])): ThemeEditorSessionCreatePayload @field(resolver: "Modules\\ThemeStore\\Resolver\\ThemeEditor\\CreateThemeEditorSessionResolver")
}
type ThemeEditorSessionCreatePayload
{
"会话"
session: Session!
}
<pre class="wp-block-syntaxhighlighter-code">
<?php
return [
'attributes' => [
'theme_id' => '主题ID',
],
];
</pre>
<pre class="wp-block-syntaxhighlighter-code">
<?php
return [
'exists' => '所选的:attribute无效。',
'attributes' => [
'theme_id' => '主题ID',
],
];
</pre>
/**
* 显示创建博客文章的表单
*
* @return Response
*/
public function create(Request $request)
{
$validator = Validator::make($request->all(), [
'theme_id' => 'required|exists:users,id',
]);
if ($validator->fails()) {
dd($validator->errors());
}
// 保存博客文章…
return view('blog::post.create');
}
<pre class="wp-block-syntaxhighlighter-code">
<?php
return [
'exists' => '所选的:attribute无效。resources',
'attributes' => [
'theme_id' => '主题ID',
],
];
</pre>
Illuminate\Support\MessageBag {#361 ▼
#messages: array:1 [▼
"theme_id" => array:1 [▼
0 => "所选的主题ID无效。resources"
]
]
#format: ":message"
}
<pre class="wp-block-syntaxhighlighter-code">
<?php
return [
'array' => ':attribute必须是一个数组。',
'attributes' => [
'filter' => '过滤器'
],
];
</pre>
{
"message": "The given data was invalid.",
"errors": {
"filter": [
"过滤器必须是一个数组。"
]
},
"status_code": 422,
"debug": {
"line": 385,
"file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Validation\\Validator.php",
"class": "Illuminate\\Validation\\ValidationException",
"trace": ...
}
}
PHP / Laravel / Yii2 老项目维护与长期技术支持
如果你的 PHP / Laravel / Yii2 项目已经上线,但遇到原开发离职、Bug 长期无人修复、接口不稳定、性能下降、代码难以接手等问题,可以联系我做一次远程技术排查。
适合以下情况:
✅ 老旧 PHP 系统无人维护
✅ Laravel / Yii2 项目 Bug 修复
✅ 后台管理系统小功能迭代
✅ RESTful API 接口排查
✅ MySQL / Redis / Nginx 性能问题
✅ 长期远程兼职维护
可先从一次小问题开始:
✅ 线上报错排查
✅ 接口异常分析
✅ 慢查询与性能瓶颈定位
✅ 代码结构初步评估
✅ 部署环境与日志检查
如需咨询,请联系我,并注明:PHP 维护咨询。
联系方式:
Telegram:@shuijingwan
微信:13980074657
邮箱:shuijingwanwq@gmail.com

发表回复