intervention / zodiac
Zodiac Sign Calculator
7.0.0
2026-04-10 05:31 UTC
Requires
- php: ^8.2
- illuminate/translation: ^11 || ^12 || ^13
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.0 || ^12.0
- slevomat/coding-standard: ~8.0
- squizlabs/php_codesniffer: ^4
- dev-develop
- 7.0.0
- 6.0.1
- 6.0.0
- 6.0.0-rc.4
- 6.0.0-rc.3
- 6.0.0-rc.2
- 6.0.0-rc.1
- 6.0.0-beta.3
- 6.0.0-beta.2
- 6.0.0-beta.1
- v5.x-dev
- 5.0.7
- 5.0.6
- 5.0.5
- 5.0.4
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- 4.1.1
- 4.1.0
- 4.0.0
- 3.1.1
- 3.1.0
- 3.0.2
- 3.0.1
- 3.0.0
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.3.0
- 1.2.0
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 1.0.0-beta
- 0.5.0
- dev-main
- dev-next
This package is auto-updated.
Last update: 2026-04-11 05:41:44 UTC
README
Intervention Zodiac is a astrological calculator for PHP 8.2+ that resolves Western and Chinese zodiac signs from various data types.
- Fluent interface to calculate zodiac signs
- Support for western and chinese astrology
- Framework-agnostic
Installation
The installation works with Composer by running the following command.
composer require intervention/zodiac
Although the library is framework agnostic it comes with a service provider for the Laravel Framework. Which will be discovered automatically and registers the calculator into your installation.
Getting Started
Read the full documentation for this library.
Code Examples
Calculator
use Intervention\Zodiac\Calculator; use Intervention\Zodiac\Astrology; use DateTime; // create calculator with astrology $calculator = new Calculator(Astrology::WESTERN); // calculate various date formats $sign = $calculator->calculate('2001-01-01'); $sign = $calculator->calculate('first day of june 2014'); $sign = $calculator->calculate('2018-06-15 12:34:00'); $sign = $calculator->calculate(new DateTime('2001-01-01')); $sign = $calculator->calculate(228268800); $sign = $calculator->calculate('228268800'); // override the default astrology $sign = $calculator->calculate('2001-01-01', Astrology::CHINESE);
Sign
use Intervention\Zodiac\Sign; use Intervention\Zodiac\Chinese\Sign as ChineseSign; use Intervention\Zodiac\Western\Sign as WesternSign; use DateTime; // parse signs directly $sign = Sign::fromString('2000-01-01'); $sign = Sign::fromString('first day of june 2014'); $sign = Sign::fromDate(new DateTime('2001-01-01')); $sign = Sign::fromUnix(228268800); $sign = Sign::fromUnix('228268800'); // parse western signs directly $sign = WesternSign::fromString('2000-01-01'); // parse chinese signs directly $sign = ChineseSign::fromString('2000-01-01'); // sign methods $name = $sign->name(); // 'gemini' $html = $sign->html(); // '♊︎' $localized = $sign->localize('fr')->name(); // Gémeaux $compatibility = $sign->compatibility($sign); // .6
Authors
This library is developed and maintained by Oliver Vogel
Thanks to the community of contributors who have helped to improve this project.
License
Intervention Zodiac is licensed under the MIT License.