based on Laravel4 Framework