PHP code example of goldnead / statamic-events

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

    

goldnead / statamic-events example snippets


$rsvps = app(\Goldnead\Events\Rsvps::class);
$rsvps->toggle($event, $user);          // going, and again to take it back
$rsvps->set($event, $user, 'interested');
$rsvps->remove($event, $user);
$rsvps->counts($event);                 // numbers, public
$rsvps->list($event, $viewer);          // names, only with `manage events`

use Goldnead\Events\Facades\Events;

Events::events(['type' => 'concert']);
Events::occurrences(['event' => 'chorworkshop', 'upcoming' => true]);
Events::next(['type' => 'concert']);
Events::feed();
bash
php artisan vendor:publish --tag=events
bash
php artisan vendor:publish --tag=events-config        # config/events.php
php artisan vendor:publish --tag=events-translations  # lang/vendor/events
php artisan vendor:publish --tag=events-migrations