Installation
composer require classiebit/eventmie
php artisan vendor:publish --provider="Classiebit\Eventmie\EventmieServiceProvider" --tag="eventmie-migrations"
php artisan migrate
php artisan eventmie:install
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'
]);
/admin/events in your browser to manage events via the admin panel.Key Directories
config/eventmie.php (adjust payment gateways, settings, and branding).routes/eventmie.php (customize event-related routes).resources/views/vendor/eventmie/ (override default templates).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
Eventmie facade for bulk operations:
use Classiebit\Eventmie\Facades\Eventmie;
Eventmie::publishEvents([$eventId1, $eventId2]); // Publish multiple events
$event->tickets()->create([
'name' => 'Early Bird',
'price' => 49.99,
'quantity' => 50,
'starts_at' => now(),
'ends_at' => now()->addDays(7),
]);
Payment model to track transactions:
$payment = $event->payments()->create([
'amount' => $ticket->price,
'gateway' => 'stripe',
'status' => 'pending',
'metadata' => ['ticket_id' => $ticket->id],
]);
Eventmie's role system:
$user->assignRole('event_organizer'); // Via spatie/laravel-permission
/admin to manage events, users, and settings. Customize permissions in config/eventmie.php.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
@include('eventmie::checkout', ['event' => $event, 'ticket' => $ticket])
Eventmie's built-in API routes in routes/api.php:
Route::get('/events', [EventResource::class, 'index']);
config/eventmie.php to handle asynchronous payments.event(new TicketPurchased($event, $user, $ticket));
Eventmie's notifications (e.g., send custom emails on ticket purchase):
use Classiebit\Eventmie\Notifications\TicketPurchased;
$user->notify(new TicketPurchased($event, $ticket));
$schedule->call(function () {
Event::find(1)->publish();
})->daily();
resources/views/vendor/eventmie/ to your project to customize templates without losing updates.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',
];
}
Migration Conflicts:
events or tickets tables, reset migrations or merge changes manually before running php artisan migrate.php artisan eventmie:install --force cautiously.Payment Gateway Misconfigurations:
config/eventmie.php are correct. Test in a staging environment first.php artisan eventmie:test-payment to validate gateway connections.Caching Issues:
php artisan view:clear
php artisan config:clear
php artisan cache:clear
Permission Denied:
admin role:
$user->assignRole('admin');
config/eventmie.php for custom permission gates.Timezone Mismatches:
.env:
APP_TIMEZONE=UTC
$event->start_at = Carbon::parse('2025-12-31 18:00:00')->timezone('America/New_York');
Asset Loading:
php artisan vendor:publish --tag="eventmie-assets"
@vite or @mix in custom views to compile assets.Log Events:
Enable debug mode in config/eventmie.php:
'debug' => env('APP_DEBUG', false),
Check logs at storage/logs/laravel.log.
Query Debugging:
Use Laravel Debugbar or dd() to inspect queries:
\DB::enableQueryLog();
$events = Event::all();
\Log::info(\DB::getQueryLog());
Common Errors:
php artisan eventmie:install to reset default data.Classiebit\Eventmie\ namespace is autoloaded (check composer.json).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.
Webhooks:
Extend payment handling by listening to payment.created events:
Event::listen('payment.created', function ($payment) {
// Custom logic (e.g., update CRM)
});
API Extensions:
Add custom API routes in routes/api.php:
Route::prefix('events')->group(function () {
Route::get('/{event}/attendees', [EventController::class, 'attendees']);
});
Multi-Tenancy: For SaaS applications, scope events by tenant:
use Classiebit\Eventmie
How can I help you explore Laravel packages today?