php - Laravel : UPDATE if exist else INSERT? -


my question written in title! exist method in laravel (eloquent, fluent...) wich update row , if row doesn't exist inserted ? guys

dunno id laravel has such method, mysql can query this

insert t set c1='foo', c2='bar' on duplicate key update c2='bar' 

you have have unique index on table make trick work


Popular posts from this blog

Php - Delimiter must not be alphanumeric or backslash -

c# - How to change the "Applies To" field under folder auditing options programatically (.NET) -

c++ - Ambiguity when using boost::assign::list_of to construct a std::vector -