laravel-helper
“Call to undefined function str_slug()” in Laravel 6.0
If you have gone through the upgrade guide then you must know that String and Array Helpers have been removed from Core Framework So if if You need to still use the helper install the package composer require laravel/helpers and all the helpers are moved to this package
Best Practices for Laravel 4 Helpers and Basic Functions?
The ugly, lazy and awful way: At the end of bootstrap/start.php , add an include(‘tools.php’) and place your function in that new file. The clean way: Create a library. That way it’ll be autoloaded ONLY when you actually use it. Create a libraries folder inside your app folder Create your library file, create a class … Read more
How to create custom helper functions in Laravel
Create a helpers.php file in your app folder and load it up with composer: “autoload”: { “classmap”: [ … ], “psr-4”: { “App\\”: “app/” }, “files”: [ “app/helpers.php” // <—- ADD THIS ] }, After adding that to your composer.json file, run the following command: composer dump-autoload If you don’t like keeping your helpers.php file … Read more