infinity-it / e-commerce-google-calendar
dev-main / 1.0.x-dev
2024-11-11 15:44 UTC
Requires
Requires (Dev)
- symfony/var-dumper: ^4.4
This package is auto-updated.
Last update: 2025-03-11 16:49:35 UTC
README
E-Commerce Google Calendar
1. Installation
composer require "infinity-it/e-commerce-google-calendar"
2. Configuration file
3. Implement Model
namespace App\Models; use ECommerce\EGoogleCalendar\Interfaces\GEventInterface; use ECommerce\EGoogleCalendar\Traits\GEventTrait; class MyModel implements GEventInterface { use GEventTrait; function toGEvent(\Spatie\GoogleCalendar\Event &$event) { // TODO: Implement toGEvent() method. // $event->name = $this->title; // $event->description = $this->description; // $event->startDateTime = $this->start; // $event->endDateTime = $this->end; // ... } function getGEventIdKey(): string { // TODO: Implement getGEventIdKey() method. // return 'event_id'; } }
4. usage
$my_model = App\Models\MyModel::find(1); $my_model->saveInGCalendar(); $my_model->start = \Carbon\Carbon::now(); $my_model->updateInGCalendar();
5. Check Google Calendar connection
php artisan calendar:check
Google Event Colors:
-
Import:
use ECommerce\EGoogleCalendar\Enums\GEventColorId;
-
Colors
-
Usage:
use Spatie\GoogleCalendar\Event; use ECommerce\EGoogleCalendar\Enums\GEventColorId; // ... function toGEvent(Event &$event): void { $event->setColorId(GEventColorId::TOMATO->value); } // ...