Closed JeroenSteen closed 2 years ago
Hello,
In your example $workingDays
is the instance of the mixin. It's not meant to be used this way.
Please follow the examples of the documentation:
BusinessTime::enable(Carbon::class, $availabilites["working"]);
var_dump(Carbon::isOpenOn("saturday"));
var_dump(Carbon::isOpenOn("monday"));
// Or On precise moment:
var_dump(Carbon::parse('2022-04-16 10:00')->isOpen());
var_dump(Carbon::parse('2022-04-16 12:00')->isOpen());
I have a JSON file with my working hours, and I'm trying to check if I'm open on a non-open day like for example saturday. But I'm getting as result only
{}
, so not for example false. When I check monday a open-day day I also get {}, and then it should be true. This is my data:And this is my PHP file:
I by the way want to use multiple 'openinghours', for working, deadlines and pickup times.