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

PSMedia90's avatar

Grammar Error

I am creating a stock management system and every time I create a new record in the database with an image I get the following error. I am using Spetie's media manager plug-in for filament.

here is the error

Illuminate\Database\Grammar::parameterize(): Argument #1 ($values) must be of type array, string given, called in /Users/sal/Code/Laravel/SignCloud/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/Grammar.php on line 1162

ProductResouce.php

Product.php

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Product extends Model
{
    use HasFactory;

    protected $fillable = [
        'image',
        'title'
    ];
}

I searched around on the web to find a solution, but I cannot figure out how to solve this error.

0 likes
3 replies
martinbean's avatar

@psmedia90 So maybe instead show the code where you’re actually trying to create the record, instead of unrelated model and resource code.

PSMedia90's avatar

@martinbean Filament handles a majority of the logic behind the scenes.

CreateProduct.php


namespace App\Filament\Resources\ProductResource\Pages;

use App\Filament\Resources\ProductResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;

class CreateProduct extends CreateRecord
{
    protected static string $resource = ProductResource::class;
}

Everything else is handled by filament and the Spetie's plug-in

Please or to participate in this conversation.