Installation:
composer require majiid/panichd-majiid
Run the web installer at /PanicHD/install (or configure manually via CLI).
First Use Case:
/PanicHD (or your custom route) to create a ticket via the built-in form.Key Files to Review:
config/panichd.php (core settings like routes, email templates).resources/views/vendor/panichd/ (customize UI templates).database/migrations/ (check for custom table structures if extending).Ticket Creation:
/PanicHD/tickets/create with built-in validation.use PanicHD\Models\Ticket;
$ticket = Ticket::create([
'title' => 'Issue with API',
'description' => 'Endpoint X fails...',
'priority' => 2,
'tags' => ['api', 'bug'],
'attachments' => [new \PanicHD\Models\Attachment(['file_path' => 'path/to/file.pdf'])]
]);
Attachments:
Attachment model or manually:
$ticket->attachments()->create([
'file_path' => $request->file('attachment')->store('panichd_attachments'),
'original_name' => $request->file('attachment')->getClientOriginalName()
]);
Notifications:
resources/views/vendor/panichd/emails/.TicketCreated):
event(new \PanicHD\Events\TicketCreated($ticket));
Filtering/Scheduling:
$tickets = Ticket::whereHas('tags', ['name' => 'urgent'])
->where('due_date', '>=', now())
->get();
ticketable_id (e.g., User model).Route::middleware('auth:sanctum')->get('/tickets', [TicketController::class, 'index']);
Ticket model or use morph maps for polymorphic relations.Route Conflicts:
/PanicHD may clash with existing routes. Override in config/panichd.php:
'route_prefix' => 'support',
File Storage:
panichd_attachments disk is configured in config/filesystems.php.storage/app/panichd_attachments.Seeding:
php artisan db:seed --class=PanicHDDatabaseSeeder after migrations.Translation Issues:
resources/lang/vendor/panichd/. Add your locale if missing.storage/logs/laravel.log for PanicHD-related errors.DB::enableQueryLog() to inspect complex filter queries.app/Providers/EventServiceProvider.php:
protected $listen = [
\PanicHD\Events\TicketCreated::class => [
\App\Listeners\LogTicketCreation::class,
],
];
Custom Actions:
Ticket model to add methods:
public function resolve()
{
// Custom logic (e.g., auto-close after 7 days)
$this->status = 'resolved';
$this->save();
}
Webhooks:
ticket.* events to trigger external actions (e.g., Slack notifications):
\PanicHD\Events\TicketUpdated::class => function ($event) {
// Send webhook to Slack
};
Middleware:
Route::middleware(['auth', 'can:view,ticket'])->group(function () {
// Ticket routes
});
Testing:
PanicHD\Tests\CreatesApplication trait for unit tests:
use PanicHD\Tests\CreatesApplication;
class TicketTest extends TestCase {
use CreatesApplication;
// ...
}
How can I help you explore Laravel packages today?