model latest laravel code example
Example 1: laravel find query
foreach (Flight::where('foo', 'bar')->cursor() as $flight) {
//
}
Example 2: laravel update first
Model::where(['x' => 1, 'y' => 2])->first()->update([...]);
foreach (Flight::where('foo', 'bar')->cursor() as $flight) {
//
}
Model::where(['x' => 1, 'y' => 2])->first()->update([...]);