The tap
helper is a great way to remove a separate return statement after calling a method on an object. Makes things nice and clean
1// without tap2$user->update(['name' => 'John Doe']);3 4return $user;5 6// with tap()7return tap($user)->update(['name' => 'John Doe']);
Tip given by @mattkingshott