karabin/laravel-confetti

PHP wrapper around Confetti API

1.0.0 2024-01-31 12:52 UTC

This package is auto-updated.

Last update: 2024-10-30 10:24:29 UTC


README

Latest Version on Packagist

Total Downloads

Basic API wrapper for Confetti events api

Installation

You can install the package via composer:

composer require karabin/laravel-confetti

You can publish the config file with:

php artisan vendor:publish --tag="laravel-confetti-config"

This is the contents of the published config file:

return [
    'token' => env('CONFETTI_API_KEY', ''),
];

Usage

Get all events

use Karabin\Confetti\Facades\Confetti;

$params = [
    'filter[signupType]' => 'rsvp',
    'filter[type]' => 'future',
    'page[size]' => 10,
    'page[number]' => $request->input('page', 1),
    'include' => 'categories,pages,pages.blocks,pages.blocks.images,images.image',
];
$events = Confetti::getEvents($params);

Get open events

use Karabin\Confetti\Facades\Confetti;

$params = [
    'filter[signupType]' => 'rsvp',
    'filter[type]' => 'future',
    'page[size]' => 10,
    'page[number]' => $request->input('page', 1),
    'include' => 'categories,pages,pages.blocks,pages.blocks.images,images.image',
];
$events = Confetti::getOpenEvents($params);

Get single event

use Karabin\Confetti\Facades\Confetti;

$params = [
    'include' => 'categories,pages,pages.blocks,pages.blocks.images,images.image',
];
$event = Confetti::getEvent($id, $params);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.