I recently upgraded Laravel version in the project to 6.x.
Now I know the helpers
class have been removed from Laravel 6.0 version.
But anyway I need to keep the [root-dir]/helpers.php file which is functions oriented, non-class file containing general purpose helper functions.
In that file I need to replace all the custom functions starting with str_
like str_contains
with Illumimnate\Support\Str
counterparts like Str::contains
. For example:
if(!function_exists('is_bot'))
{
/**
* userAgent is the user-agent header
* from the request object
* @param $userAgent
* @return bool
*/
function is_bot($userAgent)
{
return str_contains($userAgent, config('bot_check'));
}
}
How can I do that ?