laravel model update method code example
Example 1: update column value laravel
Page::where('id', $id)->update(array('image' => 'asdasd'));
Example 2: laravel create or update
$flight = App\Models\Flight::updateOrCreate(
['departure' => 'Oakland', 'destination' => 'San Diego'],
['price' => 99, 'discounted' => 1]
);
Example 3: laravel update
<!-mass update-->
App\Models\Flight::where('active', 1)
->where('destination', 'San Diego')
->update(['delayed' => 1]);
Example 4: create new record via model in laravel
$userData = array('username' => 'Me', 'email' => 'me@yahoo.com');
User::create($userData);