我使用以下功能从管理面板插入/创建新用户:
I use below function for insert/create new user from admin panel:
public function store(Request $request)
{
$this->validate($request, [
'name' => 'required',
'email' => 'required|email|unique:users,email',
'password' => 'required|same:confirm-password'
]);
$input = $request->all();
$input['password'] = Hash::make($input['password']);
User::create($input);
return redirect()->route('admin.pages.users.index')
->with('success','User created successfully');
}
当我提交时出现如下错误:-
when I submit I get error as below :-
尝试访问类型为 null 的值的数组偏移
Trying to access array offset on value of type null
我发现了我的问题.我的问题是电子邮件验证规则.当我删除电子邮件验证插入数据是真的.
I found my problem. my problem is email validation rule. when i remove email validation insert data is true.
我该如何解决这个错误!
How do can i fix this error !
将 Composer.json 中的 PHP 版本更改为 7.4.1 并运行
Change Your Php version in Composer.json to 7.4.1 and run
composer update
这对我有用
这篇关于错误“试图访问类型为 null 的值的数组偏移量"Laravel 5.8.26 PHP 7.4.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
按类别划分的 Magento 产品Magento products by categories(按类别划分的 Magento 产品)
资源被解释为图像但使用 MIME 类型 text/html 传输Resource interpreted as image but transferred with MIME type text/html - Magento(资源被解释为图像但使用 MIME 类型 text/html 传输 - Magen
Magento 中是否有客户帐户注册事件?Is there an event for customer account registration in Magento?(Magento 中是否有客户帐户注册事件?)
Magento addFieldToFilter:两个字段,匹配为 OR,而不是Magento addFieldToFilter: Two fields, match as OR, not AND(Magento addFieldToFilter:两个字段,匹配为 OR,而不是 AND)
“未找到错误 404"在 Magento 管理员登录页面quot;Error 404 Not Foundquot; in Magento Admin Login Page(“未找到错误 404在 Magento 管理员登录页面)
在 Magento 中获取订单增量 IDGet Order Increment Id in Magento(在 Magento 中获取订单增量 ID)