-1
public function slugify(string $string, array|string|null $options = null): string

    {

        // BC: the second argument used to be the separator

        if (is_string($options)) {

            $separator            = $options;

            $options              = [];

            $options['separator'] = $separator;

        }

 

        $options = array_merge($this->options, (array) $options);

 

        // Add a custom ruleset without touching the default rules

        if (isset($options['ruleset'])) {

            $rules = array_merge($this->rules, $this->provider->getRules($options['ruleset']));

        } else {

            $rules = $this->rules;


this file is vendor/cocur/slugify/src/Slugify.php:100
When i try to submit the form by select a image then giving this error
syntax error, unexpected '|', expecting variable (T_VARIABLE)

in server PHP Version 7.4.33, "cviebrock/eloquent-sluggable": "^8.0", and Project laravel framework is 8.75. Now can you guide me to fix this issue.

1
  • cviebrock/eloquent-sluggable version 8.0 is support with php version 7.4.33 ? Commented Jun 4 at 4:26

1 Answer 1

3

Union types are not supported in 7.4.xx versions. You should upgrade your PHP version to 8.x.

https://php.watch/versions/8.0/union-types

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.