PHPackages                             intervention/zodiac - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. intervention/zodiac

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

intervention/zodiac
===================

Zodiac Sign Calculator

6.0.1(2mo ago)58191.7k↑11.6%15MITPHPPHP ^8.2CI passing

Since Jan 2Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/Intervention/zodiac)[ Packagist](https://packagist.org/packages/intervention/zodiac)[ Docs](https://zodiac.intervention.io)[ Fund](https://paypal.me/interventionio)[ GitHub Sponsors](https://github.com/Intervention)[ RSS](/packages/intervention-zodiac/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (4)Dependencies (12)Versions (47)Used By (0)

Intervention Zodiac
===================

[](#intervention-zodiac)

[![Latest Version](https://camo.githubusercontent.com/48e04ddb89bad369ee63d52ee23795768081f70be3393754c703ca5949bf9b9d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e74657276656e74696f6e2f7a6f646961632e737667)](https://packagist.org/packages/intervention/zodiac)[![Tests](https://github.com/Intervention/zodiac/actions/workflows/build.yml/badge.svg)](https://github.com/Intervention/zodiac/actions/workflows/build.yml)[![Monthly Downloads](https://camo.githubusercontent.com/e09e701bee891dce59d121776907bb149e525a102603c29b1b464d380198ddee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f696e74657276656e74696f6e2f7a6f646961632e737667)](https://packagist.org/packages/intervention/zodiac/stats)[![Support me on Ko-fi](https://raw.githubusercontent.com/Intervention/zodiac/main/.github/images/support.svg)](https://ko-fi.com/interventionphp)

Intervention Zodiac is a astrological calculator that resolves Western and Chinese zodiac signs from various data types.

Installation
------------

[](#installation)

The installation works with [Composer](https://getcomposer.org) 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](https://zodiac.intervention.io/v6/introduction/frameworks). Which will be discovered automatically and registers the calculator into your installation.

Documentation
-------------

[](#documentation)

Read the full [documentation](https://zodiac.intervention.io) for this library.

Code Examples
-------------

[](#code-examples)

### Calculator

[](#calculator)

```
use Intervention\Zodiac\Calculator;
use Intervention\Zodiac\Astrology;
use Carbon\Carbon;
use DateTime;

$sign = Calculator::fromString('2001-01-01');
$sign = Calculator::fromString('2001-01-01', Astrology::CHINESE);

// create western calculator
$sign = Calculator::western()
    ->fromString('2001-01-01');

// create chinese calculator
$sign = Calculator::chinese()
    ->fromString('2001-01-01');

// override default
$sign = Calculator::western()
    ->fromString('2001-01-01', Astrology::CHINESE);

// pass astrology as a parameter
$sign = Calculator::withAstrology(Astrology::CHINESE)
    ->fromString('2001-01-01');

// override default
$sign = Calculator::withAstrology(Astrology::CHINESE)
    ->fromString('2001-01-01', Astrology::WESTERN);

// parse various date formats
$sign = Calculator::fromString('first day of june 2014');
$sign = Calculator::fromString('2018-06-15 12:34:00');
$sign = Calculator::fromDate(new DateTime('2001-01-01'));
$sign = Calculator::fromDate(Carbon::yesterday());
$sign = Calculator::fromUnix(228268800);
$sign = Calculator::fromUnix('228268800');
```

### Sign

[](#sign)

```
use Intervention\Zodiac\Calculator;
use DateTime;
use Carbon\Carbon;

// calculate zodiac sing
$sign = Calculator::fromDate($date);

$name = $sign->name(); // 'gemini'
$html = $sign->html(); // '♊︎'
$localized = $sign->localize('fr')->name(); // Gémeaux
$compatibility = $sign->compatibility($sign); // .6
```

Development &amp; Testing
-------------------------

[](#development--testing)

With this package comes a Docker image to build a test suite container. To build this container you have to have Docker installed on your system.

You can run all tests with the following command.

```
docker-compose run --rm --build tests
```

Run the static analyzer on the code base.

```
docker-compose run --rm --build analysis
```

Authors
-------

[](#authors)

This library is developed and maintained by [Oliver Vogel](https://intervention.io)

Thanks to the community of [contributors](https://github.com/Intervention/zodiac/graphs/contributors) who have helped to improve this project.

License
-------

[](#license)

Intervention Zodiac is licensed under the [MIT License](LICENSE).

###  Health Score

65

—

FairBetter than 99% of packages

Maintenance85

Actively maintained with recent releases

Popularity47

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity88

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~84 days

Recently: every ~25 days

Total

45

Last Release

79d ago

Major Versions

1.3.0 → 2.0.02020-02-25

2.2.0 → 3.0.02022-01-13

3.1.1 → 4.0.02024-02-01

4.1.1 → 5.0.02024-11-11

5.0.7 → 6.0.0-beta.12025-11-16

PHP version history (7 changes)0.5.0PHP &gt;=5.4.0

1.3.0PHP ^7.0

2.0.0PHP ^7.2

2.1.1PHP ^7.3|^8.0

4.0.0PHP ^8.0

4.1.0PHP ^8.1

6.0.0-beta.1PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d172b42b2c5b53e71e56589fed3fb3467234a1c266d31b697b1d7b451f4cfe8?d=identicon)[olivervogel](/maintainers/olivervogel)

---

Top Contributors

[![olivervogel](https://avatars.githubusercontent.com/u/884642?v=4)](https://github.com/olivervogel "olivervogel (221 commits)")[![ergonomicus](https://avatars.githubusercontent.com/u/11394513?v=4)](https://github.com/ergonomicus "ergonomicus (6 commits)")[![fabriciojso](https://avatars.githubusercontent.com/u/1298122?v=4)](https://github.com/fabriciojso "fabriciojso (3 commits)")[![arnidan](https://avatars.githubusercontent.com/u/5755685?v=4)](https://github.com/arnidan "arnidan (2 commits)")[![jeffsmor](https://avatars.githubusercontent.com/u/40842204?v=4)](https://github.com/jeffsmor "jeffsmor (2 commits)")[![mustardandrew](https://avatars.githubusercontent.com/u/7501643?v=4)](https://github.com/mustardandrew "mustardandrew (1 commits)")[![ozgurkaragoz](https://avatars.githubusercontent.com/u/6477375?v=4)](https://github.com/ozgurkaragoz "ozgurkaragoz (1 commits)")[![serima](https://avatars.githubusercontent.com/u/1130921?v=4)](https://github.com/serima "serima (1 commits)")[![AkioSarkiz](https://avatars.githubusercontent.com/u/42392852?v=4)](https://github.com/AkioSarkiz "AkioSarkiz (1 commits)")[![sorasu](https://avatars.githubusercontent.com/u/2067943?v=4)](https://github.com/sorasu "sorasu (1 commits)")[![amirsadeghi1](https://avatars.githubusercontent.com/u/26359326?v=4)](https://github.com/amirsadeghi1 "amirsadeghi1 (1 commits)")[![baceto90](https://avatars.githubusercontent.com/u/20355435?v=4)](https://github.com/baceto90 "baceto90 (1 commits)")[![hoangphison](https://avatars.githubusercontent.com/u/9270621?v=4)](https://github.com/hoangphison "hoangphison (1 commits)")[![ludo237](https://avatars.githubusercontent.com/u/921500?v=4)](https://github.com/ludo237 "ludo237 (1 commits)")

---

Tags

zodiachoroscopebirthdaysun signstar signastrology

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/intervention-zodiac/health.svg)

```
[![Health](https://phpackages.com/badges/intervention-zodiac/health.svg)](https://phpackages.com/packages/intervention-zodiac)
```

###  Alternatives

[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[phpu/calendar

中国日历，通过天文计算和民间推算方法，准确计算出公历-1000年至3000年的农历、干支、节气等，同时支持多配置、多语言、多时区。

201.7k](/packages/phpu-calendar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
