You're trying to validate on the data itself and not the request object. Try this instead:
$attributes = request()->validate([
...
]);
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Sending data from Vue to Laravel Controller via:
urgent: {
title: 'Message Title',
body: 'Body of the message',
svg: 'exclamation'
}
axios.post('/urgent', { urgent: this.urgent })
Laravel Controller:
$attributes = request('urgent')->validate([
'title' => 'required|min:5|max:24',
'body' => 'required|min:10|max:255',
'svg' => 'required|min:3|max:25'
]);
$urgent = Urgent::create($attributes);
Telescope Payload:
urgent: {
title: "VTO BID CLOSES TODAY",
body: "If you got a VTO option during initial bid - don't forget to finish bid.",
svg: "exclamation"
}
Telescope Response:
message: "Call to a member function validate() on array",
exception: "Symfony\Component\Debug\Exception\FatalThrowableError"
Please or to participate in this conversation.