Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Replace all occurrences of the search string with the replacement string
<?php str_replace(    array|string $search,    array|string $replace,    string|array $subject,    int &$count = null): string|array
<?php             return '';

        }



        $rule = Str::snake(str_replace('validate', '', $possibleMethod));



        return "Did you mean `{$rule}` ?";

    }
<?php         foreach ($files as $file) {

            if ($file instanceof SplFileInfo) {

                $view = $file->getRelativePathname();

                $view = str_replace($extensionsWithDots, '', $view);

                $view = str_replace('/', '.', $view);

                $views[] = $view;

            }
<?php             if ($file instanceof SplFileInfo) {

                $view = $file->getRelativePathname();

                $view = str_replace($extensionsWithDots, '', $view);

                $view = str_replace('/', '.', $view);

                $views[] = $view;

            }

        }
<?php         }



        $originalContents = file_get_contents($parameters['viewFile']);

        $newContents = str_replace('$'.$parameters['variableName'], '$'.$parameters['variableName']." ?? ''", $originalContents);



        $originalTokens = token_get_all(Blade::compileString($originalContents));

        $newTokens = token_get_all(Blade::compileString($newContents));
<?php     protected function getFullyQualifiedClassNameFromFile(string $rootNamespace, SplFileInfo $file): string

    {

        $class = trim(str_replace($this->basePath, '', $file->getRealPath()), DIRECTORY_SEPARATOR);



        $class = str_replace(

            [DIRECTORY_SEPARATOR, 'App\\'],
<?php     {

        $class = trim(str_replace($this->basePath, '', $file->getRealPath()), DIRECTORY_SEPARATOR);



        $class = str_replace(

            [DIRECTORY_SEPARATOR, 'App\\'],

            ['\\', app()->getNamespace()],

            ucfirst(Str::replaceLast('.php', '', $class))

        );



        return $rootNamespace.$class;

    }