Creating And Update Laravel Eloquent
Answer : Here's a full example of what "lu cip" was talking about: $user = User::firstOrNew(array('name' => Input::get('name'))); $user->foo = Input::get('foo'); $user->save(); Below is the updated link of the docs which is on the latest version of Laravel Docs here: Updated link Updated: Aug 27 2014 - [ updateOrCreate Built into core...] Just in case people are still coming across this... I found out a few weeks after writing this, that this is in fact part of Laravel's Eloquent's core... Digging into Eloquent’s equivalent method(s). You can see here: https://github.com/laravel/framework/blob/4.2/src/Illuminate/Database/Eloquent/Model.php#L553 on :570 and :553 /** * Create or update a record matching the attributes, and fill it with values. * * @param array $attributes * @param array $values * @return static */ public static function updateOrCreate(array $attributes, array $values = ar...