used the laravel dir methods instead of making our own