public function confirmEmailByToken($token) { $customer = Customer::whereEmailToken($token)->with(['source', 'producers', 'samples'])->first(); if ($customer) { $customer->email_token = null; $customer->email_confirmed = true; $customer->save(); } return $customer; }