Laravel is very useful when we want to do basic operation .Suppose if we have a condition that we have to
Insert a new record if not exist and update if exist, If we do this task in php then we have to put if-else condition But In Laravel 4.x we have done this by using one query.
Syntax for inserting a new record if not exist and update if exist is:
$user = User::firstOrNew(ColumnName);
$user = User::firstOrNew(array('name' => Input::get('name')));
$user->foo = Input::get('foo');
In above example User is the eloquent and save is the method which will save data in the database.