Laravel Query builder insert 1 value higher than last record - development

Laravel Query builder insert 1 value higher than last record

I have a problem with laravel query builder. I have a query, which contains one value INT. It should be always 1 higher than last record in database. And I don’t know how to do it in Laravel Query builder. In raw SQL I would do

INSERT INTO table_name (name, order)
VALUES ('ahoy', order + 1);

And it should work. But I have really no idea how to do it in laravel query builder



from Laravel Questions and Answers https://laravelquestions.com/laravel/laravel-query-builder-insert-1-value-higher-than-last-record/
via Lzo Media

Comments

Popular posts from this blog

HTTP 401 Unable to create record Twillio PHP sdk 5.16 - development

Using PHP and MySQL data to generate PDF letters like in MS Word mailmerge functionality - development

ng-include of inline SVG does not display gradient except in Chrome