Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Eventmie Laravel Package

classiebit/eventmie

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation

    composer require classiebit/eventmie
    php artisan vendor:publish --provider="Classiebit\Eventmie\EventmieServiceProvider" --tag="eventmie-migrations"
    php artisan migrate
    php artisan eventmie:install
    
    • Run migrations and the installer to set up default configurations.
  2. First Use Case: Create an Event

    use Classiebit\Eventmie\Models\Event;
    
    $event = Event::create([
        'title' => 'Laravel Meetup 2025',
        'slug' => 'laravel-meetup-2025',
        'start_at' => now()->addDays(30),
        'end_at' => now()->addDays(31),
        'description' => 'Join us for a day of Laravel talks and networking.',
        'status' => 'draft', // or 'published'
    ]);
    
    • Navigate to /admin/events in your browser to manage events via the admin panel.
  3. Key Directories

    • Config: config/eventmie.php (adjust payment gateways, settings, and branding).
    • Routes: routes/eventmie.php (customize event-related routes).
    • Views: resources/views/vendor/eventmie/ (override default templates).

Implementation Patterns

Core Workflows

1. Event Creation & Management

  • Programmatic Creation: Use the Event model to create events dynamically (e.g., via API or CLI).
    $event = Event::create([...]);
    $event->categories()->attach([1, 2]); // Assign categories
    $event->venues()->attach(1); // Assign venue
    
  • Bulk Actions: Use the Eventmie facade for bulk operations:
    use Classiebit\Eventmie\Facades\Eventmie;
    
    Eventmie::publishEvents([$eventId1, $eventId2]); // Publish multiple events
    

2. Ticketing System

  • Define Ticket Types:
    $event->tickets()->create([
        'name' => 'Early Bird',
        'price' => 49.99,
        'quantity' => 50,
        'starts_at' => now(),
        'ends_at' => now()->addDays(7),
    ]);
    
  • Handle Payments: Integrate with supported gateways (Stripe, PayPal, etc.) via config. Use the Payment model to track transactions:
    $payment = $event->payments()->create([
        'amount' => $ticket->price,
        'gateway' => 'stripe',
        'status' => 'pending',
        'metadata' => ['ticket_id' => $ticket->id],
    ]);
    

3. User Roles & Permissions

  • Assign Roles: Use Laravel’s built-in gates or extend with Eventmie's role system:
    $user->assignRole('event_organizer'); // Via spatie/laravel-permission
    
  • Admin Panel: Access /admin to manage events, users, and settings. Customize permissions in config/eventmie.php.

4. Frontend Integration

  • Event Listings: Use the Event model to fetch events for your frontend:
    $events = Event::published()->latest()->take(10)->get();
    
    Render with Blade:
    @foreach($events as $event)
        <div class="event-card">
            <h3>{{ $event->title }}</h3>
            <p>{{ $event->start_at->format('M d, Y') }}</p>
            @include('eventmie::partials.buy-tickets', ['event' => $event])
        </div>
    @endforeach
    
  • Checkout Flow: Include the checkout partial:
    @include('eventmie::checkout', ['event' => $event, 'ticket' => $ticket])
    

5. API Endpoints

  • Expose Events via API: Use Laravel’s API resources or extend Eventmie's built-in API routes in routes/api.php:
    Route::get('/events', [EventResource::class, 'index']);
    
  • Webhooks: Configure payment webhooks in config/eventmie.php to handle asynchronous payments.

Integration Tips

Laravel Ecosystem

  • Queues: Use Laravel queues to process ticket purchases asynchronously:
    event(new TicketPurchased($event, $user, $ticket));
    
  • Notifications: Extend Eventmie's notifications (e.g., send custom emails on ticket purchase):
    use Classiebit\Eventmie\Notifications\TicketPurchased;
    
    $user->notify(new TicketPurchased($event, $ticket));
    
  • Scheduling: Schedule recurring events with Laravel’s scheduler:
    $schedule->call(function () {
        Event::find(1)->publish();
    })->daily();
    

Customization

  • Override Views: Copy resources/views/vendor/eventmie/ to your project to customize templates without losing updates.
  • Extend Models: Publish and extend Eventmie's models:
    php artisan vendor:publish --tag="eventmie-models"
    
    Example:
    namespace App\Models;
    
    use Classiebit\Eventmie\Models\Event as BaseEvent;
    
    class Event extends BaseEvent
    {
        protected $casts = [
            ...,
            'custom_field' => 'string',
        ];
    }
    

Gotchas and Tips

Pitfalls

  1. Migration Conflicts:

    • If you’ve modified events or tickets tables, reset migrations or merge changes manually before running php artisan migrate.
    • Fix: Backup your database and use php artisan eventmie:install --force cautiously.
  2. Payment Gateway Misconfigurations:

    • Ensure API keys in config/eventmie.php are correct. Test in a staging environment first.
    • Tip: Use php artisan eventmie:test-payment to validate gateway connections.
  3. Caching Issues:

    • Clear caches after customizing views or configurations:
      php artisan view:clear
      php artisan config:clear
      php artisan cache:clear
      
  4. Permission Denied:

    • If admin routes return 403, ensure the user has the admin role:
      $user->assignRole('admin');
      
    • Debug: Check config/eventmie.php for custom permission gates.
  5. Timezone Mismatches:

    • Events use the system timezone. Set it explicitly in .env:
      APP_TIMEZONE=UTC
      
    • Tip: Use Carbon for timezone-aware dates:
      $event->start_at = Carbon::parse('2025-12-31 18:00:00')->timezone('America/New_York');
      
  6. Asset Loading:

    • If CSS/JS fails to load, publish assets:
      php artisan vendor:publish --tag="eventmie-assets"
      
    • Tip: Use @vite or @mix in custom views to compile assets.

Debugging

  1. Log Events: Enable debug mode in config/eventmie.php:

    'debug' => env('APP_DEBUG', false),
    

    Check logs at storage/logs/laravel.log.

  2. Query Debugging: Use Laravel Debugbar or dd() to inspect queries:

    \DB::enableQueryLog();
    $events = Event::all();
    \Log::info(\DB::getQueryLog());
    
  3. Common Errors:

    • SQLSTATE[42S22]: Column not found? Run php artisan eventmie:install to reset default data.
    • Class not found: Ensure Classiebit\Eventmie\ namespace is autoloaded (check composer.json).

Extension Points

  1. Custom Fields: Extend the Event model to add custom fields:

    // config/eventmie.php
    'event_fields' => [
        'custom_field' => 'Custom Field',
    ];
    

    Add to migrations and model casts.

  2. Webhooks: Extend payment handling by listening to payment.created events:

    Event::listen('payment.created', function ($payment) {
        // Custom logic (e.g., update CRM)
    });
    
  3. API Extensions: Add custom API routes in routes/api.php:

    Route::prefix('events')->group(function () {
        Route::get('/{event}/attendees', [EventController::class, 'attendees']);
    });
    
  4. Multi-Tenancy: For SaaS applications, scope events by tenant:

    use Classiebit\Eventmie
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui