Creating and Update Laravel Eloquent

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

Leave a Comment