savannabits / filament-flatpickr

Extend your Filament Date-Picking with Flatpickr
MIT License
43 stars 29 forks source link

[Bug]: syntax error, unexpected token "|", expecting ")" #57

Closed flashmediasolutions closed 2 months ago

flashmediasolutions commented 2 months ago

What happened?

syntax error, unexpected token "|", expecting ")"

How to reproduce the bug

Seen on initial load.

Package Version

3.1.0

PHP Version

8.2.0

Laravel Version

10

Which operating systems does with happen with?

No response

Notes

In Flatpickr.php - $minDate|Closure is causing the syntax error.

public function minDate(Carbon|string|null $minDate|Closure): static
    {
        $this->minDate = $minDate ? Carbon::parse($minDate) : $minDate;

        return $this;
    }
crgAdrian commented 2 months ago

same here

hyphen81 commented 2 months ago

same..

AhmadFida2 commented 2 months ago

The Closure portion should be before variable.

aeq-dev commented 2 months ago

same here

ionutrobert commented 2 months ago

same here.

crgAdrian commented 2 months ago

any updates?

Emmanuel71git commented 2 months ago

same problem here with following code in AppServiceProvider:

Flatpickr::macro('customFlatpickr', function () { return $this->enableSeconds(false) ->dateFormat("d-m-Y H:i")->use24hr(true)->theme(FlatpickrTheme::AIRBNB); });

LucasVieira2902 commented 2 months ago

any updates ? same problem here

image

divdax commented 2 months ago

same

divdax commented 2 months ago

@coolsam726 new tag/release pls? :)

mikevcube commented 2 months ago

@coolsam726 can you release?

zailmer30 commented 1 month ago

Have you found any solution for this error? @flashmediasolutions

hyphen81 commented 1 month ago

Any idea on when this fix will get released? Affecting a production app for me currently.

aeq-dev commented 1 month ago

As we can see, the package owner has a bad experience regarding PRs and issues !!

divdax commented 1 month ago

@hyphen81 you could require "coolsam/flatpickr": "3.x-dev#3a0af9fcba5088acc73405f79496dea8a573ed54", for now.

@aeq-dev maybe the maintainer currently has no time. Don't be disrespectful. If you don't like @coolsam726 work create your own package and maintain it yourself. This is open source!

aeq-dev commented 1 month ago

@divdax This doesn't concern you, so you can keep your reply to yourself

Emmanuel71git commented 1 month ago

Thank you @hyphen81 I didn't know this and I'll try it out. it seems like a nice workaround for now. At the risk of getting yelled at... I've been waiting several weeks now for a release. And yes, I want to applaud the work and effort for bringing flatpickr to filament very much. But I feel respect has to go both ways. A short message from the maintainer about when a release could be expected would have been nice too, but maybe that was not possible for some reason. So anyway, I'm just glad I learned something new through this.

ChWebTech commented 1 month ago

Same here.

syntax error, unexpected token "|", expecting ")"

kurob1993 commented 1 month ago

same issue

solved it on me, used "coolsam/flatpickr": "~3.0.1" in composer.json, before any more fixes

brunocascio commented 1 month ago

Until a new release is published, it can be installed by using:

composer require coolsam/flatpickr:3.x-dev