---
application: "Intervention Zodiac"
version: "Version 7"
status: "stable"
---

# Framework Integration

## Integration in Laravel

Integrate Intervention Zodiac with Laravel. Setup guide for configuration files and using the zodiac calculator via static facades.


## Laravel

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.

### Application-wide Configuration

A global configuration file that is recognized by Laravel is included. It is
therefore possible to configure a default setting for the astrology to be used
by the calculator facade.

The configuration file can be copied to the application with the following command.

```bash
php artisan vendor:publish --provider="Intervention\Zodiac\Laravel\ServiceProvider"
```

This command will publish the configuration file `config/zodiac.php` to your local 
application's config folder. Here you can set the default astrology type to be used for
calculations.

```php
return [

    /*
    |--------------------------------------------------------------------------
    | Zodiac Astrology
    |--------------------------------------------------------------------------
    |
    | Define the default astrology to be used application-wide
    | for calculating zodiac signs. You can choose between Western
    | and Chinese astrology.
    */

    'astrology' => \Intervention\Zodiac\Astrology::WESTERN,
];
```

### Static Facade Interface

This package also integrates access to the central entry point `Intervention\Zodiac\Calculator::class`, via a static [facade](https://laravel.com/docs/facades). 

The following code example shows how to calculate a zodiac sign via the zodiac facade in a Laravel application.

```php
use Illuminate\Http\Request;
use Intervention\Zodiac\Laravel\Facades\Zodiac;

Route::get('/', function (Request $request) {
    $sign = Zodiac::calculate($request->input('date'));
});
```

---

## Become a Sponsor

### Intervention Zodiac needs your help to keep the project going

Intervention Zodiac is non-commercial, open source licensed and completely free to use. The considerable
effort required to maintain and develop the software is only possible with the financial support
of sponsors. There are two ways in which you can support this project.

- Support via [GitHub Sponsors](https://github.com/sponsors/Intervention)
- Support via [Ko-Fi](https://ko-fi.com/interventionphp)