hallindavid / manny

a light-weight PHP package of useful common manipulators/formatters.
MIT License
37 stars 5 forks source link

It is not working anymore! #16

Open marcellopato opened 7 months ago

marcellopato commented 7 months ago

Hi! First, great job!

I do have this one installed, and it was working good, suddenly one of the inputs stopped working. Let me show some code:

public function updated($field) { if ($field == 'cpf') { $this->cpf = Manny::mask($this->cpf, "111.111.111-11"); } if ($field == 'celular') { $this->celular = Manny::mask($this->celular, "(11) 11111-1111"); } if ($field == 'telefone') { $this->telefone = Manny::mask($this->telefone, "(11) 1111-1111"); } if ($field == 'peso') { $this->peso = Manny::mask($this->peso, "111,11"); } if ($field == 'altura') { $this->altura = Manny::mask($this->altura, "1,11"); } }

And at the blade:

`

@if($cpf) @else @endif @error('cpf') {{ $message }} @enderror
                </div>`

When start to type the message below appears and I have no clue what this is about!

ArgumentCountError PHP 8.2.14 10.42.0 Too few arguments to function Illuminate\Support\Str::studly(), 0 passed in /var/www/html/vendor/livewire/livewire/src/helpers.php on line 13 and exactly 1 expected

pjkellar commented 7 months ago

@marcellopato It's hard to tell what's going on here with the limited stack trace provided, although I don't believe this to be an issue with Manny specifically. Considering you mentioned that it was working "good" and then something stopped working, there must have been some other factor that caused this.

The stack trace indicates there is an issue with the arguments being passed in to Str::study() which is part of the Illuminate\Support\Str helper class; Manny does not use this class.