when i use str_random() in some Model, i have error like this:
Call to undefined function App\str_random()
Hi there,
Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:
However, this issue will not be locked and everyone is still free to discuss solutions to your problem!
Thanks.
I know.
but i think str_random() is php function. and it should not know as App\str_random() and when i migrate from 5.8 to 6.x i have this error!
but i think
str_random()is php function.
Are you sure? https://github.com/laravel/helpers/blob/master/src/helpers.php#L482-L485
Yes it is php function.but when i use in laravel model : laravel think its models function!
use Illuminate\Support\Str;
$var = Str::random(32);
Thanks @jimoheokoh
Most helpful comment
use Illuminate\Support\Str;$var = Str::random(32);