Skip to content

Unable to insert new row if table is empty (fix included) #5

@richardalain83

Description

@richardalain83

Hi,
I'm using Laravel 5.2 and I was unable to insert row if the table of my model was empty.

I found the fix in DatatablesEditor.php
line 84 replace inside else statement: $model = $model::all(); by $model = new $model;
and line 88: $model[0]->create($input['data'][$rowFirstId]); by $model->create($input['data'][$rowFirstId]);

I

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