Skip to content

Error on seeding #3

@tekord

Description

@tekord

Just installed this package into MoonShine v1.64 project and followed your instructions in README: ran migrations, published config, etc. Then I made a new console command to seed my database:

settings([
            ['group.setting1' => 'Value1'],
            ['group.setting2' => 'Value2'],
            ['group.setting3' => 'Value3'],
            ['setting1' => 'Value4'],
            ['setting2' => 'Value5'],
            ['setting3' => 'Value6'],
            ['setting4' => 'Value7'],
            ['setting5' => 'Value8']
        ]);

Then tried to run the command and got the following error:


   Illuminate\Database\QueryException 

  Array to string conversion (Connection: mysql, SQL: insert into `settings` (`setting_group_id`, `slug`, `value`, `updated_at`, `created_at`) values (?, 0, ?, 2023-11-21 10:36:25, 2023-11-21 10:36:25))

  at vendor\laravel\framework\src\Illuminate\Database\Connection.php:822
    818тЦХ                     $this->getName(), $query, $this->prepareBindings($bindings), $e
    819тЦХ                 );
    820тЦХ             }
    821тЦХ 
  тЮЬ 822тЦХ             throw new QueryException(
    823тЦХ                 $this->getName(), $query, $this->prepareBindings($bindings), $e
    824тЦХ             );
    825тЦХ         }
    826тЦХ     }

  1   vendor\laravel\framework\src\Illuminate\Database\Connection.php:722
      ErrorException::("Array to string conversion")

  2   vendor\laravel\framework\src\Illuminate\Database\Connection.php:722
      PDOStatement::bindValue(["Value1"])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions