PHP code example of bradietilley / carbon-zodiac

1. Go to this page and download the library: Download bradietilley/carbon-zodiac library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bradietilley / carbon-zodiac example snippets


use BradieTilley\Zodiac\Zodiac;
use Carbon\Carbon;

Zodiac::boot(); // automatic in Laravel via service provider

$date = Carbon::parse('1970-02-06');

$date->zodiacYear();    // Year<1970>
$date->zodiacSign();    // Sign::DOG
$date->zodiacElement(); // Element::METAL

$result = $date->zodiac();
$result->year;    // Year
$result->sign;    // Sign::DOG
$result->element; // Element::METAL