Coupon */ public function coupon() { return $this->belongsTo(\App\Models\Coupon::class, 'calendrier_couponId'); } // * METHODS /** * Check if the current date is between the calendar publication dates. * * @return boolean */ public function isPublished(): bool { return now()->betweenIncluded( Carbon::parse($this->calendrier_startdate), Carbon::parse($this->calendrier_enddate)->endOfDay() ); } }