© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
26 replies
Shaung Bhone

Argument #1 ($values) must be of type array, string given

Pardon, I don't understand what the error is? I'm trying create comment for topic. I got these error.
Argument #1 ($values) must be of type array, string given
Argument #1 ($values) must be of type array, string given

//

public ?array $data = [];
//

$record = Comment::create([
    array_merge($data, [
        'user_id' => auth()->id(),
        'topic_id' => $this->topic->id,
    ]),
]);
//

public ?array $data = [];
//

$record = Comment::create([
    array_merge($data, [
        'user_id' => auth()->id(),
        'topic_id' => $this->topic->id,
    ]),
]);

Thank you.
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

getUrl Argument #1 $parameters must be of type array, string given.
FilamentFFilament / ❓┊help
2y ago
Argument #2 ($label) must be of type string, array given
FilamentFFilament / ❓┊help
3y ago
Section - must be of type string, array given
FilamentFFilament / ❓┊help
3y ago
League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, array given
FilamentFFilament / ❓┊help
3y ago