Custom code reuse functions in Laravel 6