Skip to content
Discussion options

You must be logged in to vote

@gvillela7

Hey — I feel your pain.

Please try this.

save() is an instance method, so Model::save([...]) won’t work the way you expect.
Also, the payload in your example uses JS object syntax. In PHP it must be an associative array (=>).

So, if you want to make a new record , create() please try this method !!

Model::create([
    'store' => [
        'id' => 1,
        'name' => 'Store1',
        'theme' => [
            'colors' => [
                'text' => ['primary' => '#683E9D', 'secondary' => '#1a202c'],
                'header' => ['primary' => '#683E9D', 'secondary' => '#1a202c'],
                'pallete' => ['primary' => '#683E9D', 'secondary' => '#1a202c'],
            ],
    …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by GromNaN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants