PHP code example of 8fold / php-eventbrite-sdk

1. Go to this page and download the library: Download 8fold/php-eventbrite-sdk 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/ */

    

8fold / php-eventbrite-sdk example snippets


// creates an Organization object
$eb = Eventbrite::setAuthToken(YOUR_AUTH_TOKEN, true);

// to get all the organizers
$eb->user->organizers

// to get all the events owned by the user
$eb->user->events;

// TODO: Verify
$event = new Event();
$event->name_html      = 'Hello world!';
$event->start_utc      = '2017-01-01T01:00:00Z';
$event->start_timezone = 'America/New York';
$event->end_utc        = '2017-01-02T01:00:00Z';
$event->end_timezone   = 'America/New York';
$event->currencty      = 'USD';
$event->save();

$event = Event::find(Eventbrite, :id);

$event = Event::find(Eventbrite, :id);
$event->name_html = 'Oh, hi Mark.';
$event->save();

$event = Event::find(Eventbrite, :id);
$ticketClasses = $event->ticketClasses;

$event = Event::find(Eventbrite, :id);
$ticket_classes = $event->ticketClasses;

$event = Event::find(Eventbrite, :id);
$ticketClass = $event->ticketClassWithId(:ticket_class_id);

// OR

$ticketClass = TicketClass::find($event, :ticket_class_id);

$event = Event::find(Eventbrite, :id);
$ticket_classes = $event->ticket_classes;
$ticketClass = $ticket_classes[0];
$ticketClass->cost = 2000; // USD only right now
$ticketClass->save();

$event = Event::find(Eventbrite, :id);
$discounts = $event->discounts;

$event = Event::find(Eventbrite, :id);
$discount = $event->ticketClassWithId(:discount_id);

// OR

$discount = TicketClass::find($event, :discount_id);

$event = Event::find(Eventbrite, :id);
$displaySettings = $event->display_settings;

$event = Event::find(Eventbrite, :id);
$accessCodes = $event->access_codes;

$event = Event::find(Eventbrite, :id);
$attendees = $event->attendees;

" "8fold/eventbrite-sdk-php": "*"
}