Skip to content
Snippets Groups Projects
Commit 5bdec7a0 authored by Evgeny Lavrik's avatar Evgeny Lavrik
Browse files

Fix laravel template

parent 818ce48d
No related branches found
Tags v1.2.0
No related merge requests found
No preview for this file type
......@@ -216,7 +216,7 @@ class BaseModelVersioned extends Model
Cache::flush(static::class);
if (!$this->Id || $this->Id == -1) {
if (is_null($this->Id) || $this->Id == -1) {
$next = $this->selectRaw('COALESCE(MAX("Id") + 1,0)')->from($this->table)->toSql();
$attrs = $this->getAttributes();
$attrs["Id"] = DB::raw("($next)");
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment