amoori/ticketit-legacy
Archived Laravel helpdesk/ticket system (Laravel 5.1–5.8, 6–8). Integrates with default users/auth; roles for users/agents/admins; ticket creation, comments, closing; auto-assign agents by department/queue; admin panel, stats, localization, image uploads.
Installation
composer require amoori/ticketit-legacy
Publish the package assets and migrations:
php artisan vendor:publish --provider="Amoor\Ticketit\TicketitServiceProvider" --tag="migrations"
php artisan vendor:publish --provider="Amoor\Ticketit\TicketitServiceProvider" --tag="config"
php artisan vendor:publish --provider="Amoor\Ticketit\TicketitServiceProvider" --tag="public"
Run migrations:
php artisan migrate
Configuration
Update .env with:
TICKETIT_ENABLED=true
TICKETIT_DEFAULT_CATEGORY_ID=1
Review config/ticketit.php for customizations (e.g., email templates, permissions).
First Use Case Create a ticket via Tinker or a controller:
use Amoor\Ticketit\Models\Ticket;
$ticket = Ticket::create([
'title' => 'Test Ticket',
'description' => 'This is a test ticket.',
'user_id' => auth()->id(),
'category_id' => 1,
]);
Ticket Creation
Ticket::create() or Ticket::store() (if using the package’s form helpers).TicketCreated) or queue jobs for async processing.{!! Form::open(['route' => 'tickets.store']) !!}
{!! Form::text('title') !!}
{!! Form::textarea('description') !!}
{!! Form::submit('Submit Ticket') !!}
{!! Form::close !!}
Ticket Management
Ticket::query()->with(['user', 'category', 'replies'])->get().whereStatus(), whereCategoryId(), or use the package’s built-in scopes:
Ticket::assignedTo(auth()->user())->open()->get();
assigned_to_id and trigger TicketAssigned event.Replies and Notifications
Ticket::find($id)->replies()->create(['body' => '...']).TicketReplyCreated to send notifications (e.g., via Laravel Notifications).Permissions
Gate::define('delete-ticket', function ($user, $ticket) {
return $user->isAdmin() || $ticket->user_id === $user->id;
});
resources/assets/ticketit/) into your main assets.Route::apiResource('tickets', 'TicketController')->middleware('auth:api');
title/description:
Ticket::search('urgent')->get();
TicketStatusUpdated) to trigger external actions.Laravel Version Mismatch
laravel/framework:^6.0) or fork the package.Missing Middleware
/tickets may lack auth middleware. Add:
Route::middleware(['auth'])->group(function () {
Route::resource('tickets', 'TicketController');
});
Email Configuration
config/ticketit.php if using SMTP/Gmail:
'mail' => [
'from' => ['address' => 'support@example.com', 'name' => 'Support Team'],
],
Database Collisions
users or categories tables.database/migrations/ and adjust column names (e.g., ticket_user_id vs. user_id).Asset Paths
public/ticketit/) may not auto-update. Clear cached views:
php artisan view:clear
config/ticketit.php:
'debug' => env('APP_DEBUG', false),
EventServiceProvider:
protected $listen = [
'Amoor\Ticketit\Events\TicketCreated' => [
function ($event) {
\Log::debug('Ticket created:', $event->ticket);
},
],
];
Custom Fields
Ticket model to add morph-to relationships:
public function customFields()
{
return $this->morphMany(CustomField::class, 'fieldable');
}
Status Machine
status transitions in app/Providers/TicketitServiceProvider:
Ticket::macro('close', function () {
$this->update(['status' => 'closed']);
event(new TicketStatusUpdated($this, 'closed'));
});
Testing
$ticket = factory(Ticket::class)->create(['user_id' => $user->id]);
Event::fake();
$ticket->replies()->create(['body' => 'Test']);
Event::assertDispatched(TicketReplyCreated::class);
Localization
resources/lang/. Example:
'ticketit::tickets.status.open' => 'Open (Custom)',
How can I help you explore Laravel packages today?