added dictionary method to eloquent collections and wrote a test for it