Laravel:UPDATE如果存在其他INSERT?

My question is exactly about what is written in the title! It exist a method in laravel (Eloquent, Fluent...) wich UPDATE a row and if this row doesn't exist it will be INSERTed ? Thanks Guys

Dunno id Laravel has such a method, but with mysql you can do that with a query like this

INSERT INTO t SET c1='foo', c2='bar' ON DUPLICATE KEY UPDATE c2='bar'

You have to have an unique index on this table to make trick work