/** * Get User Object * @param [type] $id [description] * @return [type] [description] */ function getUser($id) { return User::with('info')->whereId($id)->firstOrFail(); }
/** * Fetch user * (You can extract this to repository method) * * @param $username * @return mixed */ public function getUserByUsername($username) { return User::with('info')->whereUsername($username)->firstOrFail(); }