PHP code example of capeandbay / birdeye

1. Go to this page and download the library: Download capeandbay/birdeye 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/ */

    

capeandbay / birdeye example snippets




return [
    'api_url' => env('BIRDEYE_API_URL','https://api.birdeye.com/resources'),
    'deets' => [
        'api_key' => env('BIRDEYE_API_KEY', ''),
        'parent_business_id' => env('BIRDEYE_PARENT_BUSINESS_KEY', '') // Leave blank if using multiple accounts
    ],
    'accounts' => [],
    'class_maps' => [],
];



return [
    // Other configs left out for brevity
    'accounts' => [
        'client-a' => env('BIRD_EYE_CLIENT_A_KEY', 'something'),
        'client-b' => 'some-token'
    ],
];




namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use CapeAndBay\BirdEye\Traits\HasBirdEyeBusiness;

class StoreLocation extends Model
{
    use HasBirdEyeBusiness, SoftDeletes;
   
    public $birdeye_id_column = 'some_column';
 
    /** Rest of the Logic assumed */
}



    use App\LocationModel;

    $location = LocationModel::find(1);  
    $birdeye_biz = $location->birdeye_business()->first();



    use App\StoreLocation; //Uses HasBirdEyeBusiness trait attached
    use CapeAndBay\BirdEye\Facades\BirdEye;

    $location = StoreLocation::find(1);
    $business = $location->birdeye_business()->first();
    $payload = [
       'name' => 'Some Name',
       'emailId' => '[email protected]',
       'phone' => '5555551212',
       'smsEnabled' => '1',
   ];
    $birdeye_customer = BirdEye::get('customer', $business->business_id);
    $checkin_response = $birdeye_customer->checkin($payload);

    return $checkin_response;
bash
php artisan vendor:publish --provider="CapeAndBay\BirdEye\CBBirdEyeServiceProvider" --tag="config"
bash
php artisan vendor:publish --provider="CapeAndBay\BirdEye\CBBirdEyeServiceProvider" --tag="migrations"
bash
php artisan migrate
bash
$ php artisan birdeye:init