Removed unnecessary use statement
Added controller method to check if user is logged in
Added utility to get variable via a dotted path from an array or object