Improve API for Laravel util class and add tests