'pt', * 'timezone' => 'America/Sao_Paulo', * ]; * Carbon::macro('userFormat', function () use ($userSettings) { * return $this->copy()->locale($userSettings['locale'])->tz($userSettings['timezone'])->calendar(); * }); * echo Carbon::yesterday()->hours(11)->userFormat(); * ``` * * @param string $name * @param object|callable $macro * * @return void */ public static function macro($name, $macro) { static::$globalMacros[$name] = $macro; } /** * Remove all macros and generic macros. */ public static function resetMacros() { static::$globalMacros = []; static::$globalGenericMacros = []; } /** * Register a custom macro. * * @param object|callable $macro * @param int $priority marco with higher priority is tried first * * @return void */ public static function genericMacro($macro, $priority = 0) { if (!isset(static::$globalGenericMacros[$priority])) { static::$globalGenericMacros[$priority] = []; krsort(static::$globalGenericMacros, SORT_NUMERIC); } static::$globalGenericMacros[$priority][] = $macro; } /** * Checks if macro is registered globally. * * @param string $name * * @return bool */ public static function hasMacro($name) { return isset(static::$globalMacros[$name]); } /** * Get the raw callable macro registered globally for a given name. * * @param string $name * * @return callable|null */ public static function getMacro($name) { return static::$globalMacros[$name] ?? null; } /** * Checks if macro is registered globally or locally. * * @param string $name * * @return bool */ public function hasLocalMacro($name) { return ($this->localMacros && isset($this->localMacros[$name])) || static::hasMacro($name); } /** * Get the raw callable macro registered globally or locally for a given name. * * @param string $name * * @return callable|null */ public function getLocalMacro($name) { return ($this->localMacros ?? [])[$name] ?? static::getMacro($name); } } __halt_compiler();----SIGNATURE:----MdxmroAPfT6FmSMjwys2B6DOTBj9pG8KJnYVuu5up5Z/zctgQq2f/wLKACR5KdoFUg44w9+p9QsIqA9VFvty5+ypSyaJJbYjSPT+xALr7w0qNILMCUt5ORHMX5Z+JZm2Bi/sL0kwPybjkyPmnCFPkBz58A+GlzJzn4b4J6zt8X6ELXZ/P+h6je0lsTdwlGGKYrlRHbqBj0q2dmnspOjJCODuxN/1jWqGwZWi/r98t72XH0oUH2y1Rn/nhEGTxD+NQDgCliosVCJRTNFKvA9wV6igZQAyRhcmrg0zZQ+QSZrVskfURpOq6diNnAJgxpILf9jITQaDgs0/AIb8Mebrvx/t3t4Oi5D2vctj6otnSElSID3Fanhh2y5wQ8lr0bmcPcaY99oF/VCu9Hdwci+A9emqG0k9tAimIAZgXP4qLw7giPOb6VSQqPqVtZlsYKcVSQrW11UZd4iHDQiJrPsLFwi+ZR4h2fcWATppIqopIKcZxZpRRyo35RCc6VETdhPoly37ZAxJEQsB99/gLGeClzu84kU3cw2gGXYJjXqMlomejHTrxtQpX2DSWmJHDWA7MC7+UwlnshZGf1aPQbA2TdVxJoy9///Lt9Ne2e7eEygEX1YAhhswyirX4z+pAEC8PDS49mQF3H2CLbfh3/slq74WY/+oLAveYEVG3uyCgfw=----ATTACHMENT:----ODE5Nzc2MTY5MDk0MTQyMyA5ODc3Mzk5MTI5NzE0Mzg4IDExOTE5MjQxMzc1Njc2OTY=