Nosean
4 months ago

Array to String conversion ???

Posted 4 months ago by Nosean

Hello,

i have a problem with Seeds.

My Seeder Code:


    public function run()
    {
        $author = Role::create([
            'name' => 'Admin',
            'slug' => 'admin',
            'permissions' => [
                'is-admin' => true,
            ]
        ]);

    }

when I try to execute the following command: php artisan db:seed, I receive the following error message:

 Array to string conversion (SQL: insert into `roles` (`name`, `slug`, `permissions`, `updated_at`, created_at`) values (Admin, admin, 1, 2019-04-22 08:36:33, 2019-04-22 08:36:33))

I wonder why the permissions value is 1 and not {is-admin "true}. The DB field is a long text field

anyone an idea?

Please sign in or create an account to participate in this conversation.