Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

shez1983's avatar

Trying to update a date returns an error (preg_match...)

Ok so I am doing something like:

$this->user->update(['id' => $userId], ['expires' => $date]);

if i replace 'expires' => $date with another column for example (is_deactivated => 1) it all works fine..

Error I am getting is:

ErrorException in helpers.php line 686:
preg_replace(): Parameter mismatch, pattern is a string while replacement is an array
0 likes
1 reply
shez1983's avatar
shez1983
OP
Best Answer
Level 23

Ok i was being stupid.. i was using request->only() which returns an array!

Please or to participate in this conversation.