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

Panichd Majiid Laravel Package

majiid/panichd-majiid

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation:

    composer require majiid/panichd-majiid
    

    Run the web installer at /PanicHD/install (or configure manually via CLI).

  2. First Use Case:

    • Access /PanicHD (or your custom route) to create a ticket via the built-in form.
    • Attach files, assign tags, and set a priority using the UI.
  3. 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).

Implementation Patterns

Core Workflows

  1. Ticket Creation:

    • Use the form at /PanicHD/tickets/create with built-in validation.
    • Programmatically create tickets via:
      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'])]
      ]);
      
  2. Attachments:

    • Handle uploads via the Attachment model or manually:
      $ticket->attachments()->create([
          'file_path' => $request->file('attachment')->store('panichd_attachments'),
          'original_name' => $request->file('attachment')->getClientOriginalName()
      ]);
      
  3. Notifications:

    • Extend email templates in resources/views/vendor/panichd/emails/.
    • Trigger notifications via events (e.g., TicketCreated):
      event(new \PanicHD\Events\TicketCreated($ticket));
      
  4. Filtering/Scheduling:

    • Use the built-in search form or query tickets via:
      $tickets = Ticket::whereHas('tags', ['name' => 'urgent'])
                        ->where('due_date', '>=', now())
                        ->get();
      

Integration Tips

  • Authentication: Tie tickets to users via ticketable_id (e.g., User model).
  • API Access: Expose endpoints via Laravel Sanctum/Passport:
    Route::middleware('auth:sanctum')->get('/tickets', [TicketController::class, 'index']);
    
  • Custom Fields: Extend the Ticket model or use morph maps for polymorphic relations.

Gotchas and Tips

Pitfalls

  1. Route Conflicts:

    • Default route /PanicHD may clash with existing routes. Override in config/panichd.php:
      'route_prefix' => 'support',
      
  2. File Storage:

    • Ensure panichd_attachments disk is configured in config/filesystems.php.
    • Default storage path: storage/app/panichd_attachments.
  3. Seeding:

    • Run php artisan db:seed --class=PanicHDDatabaseSeeder after migrations.
    • Demo data may overwrite existing records—back up first.
  4. Translation Issues:

    • Language files are in resources/lang/vendor/panichd/. Add your locale if missing.

Debugging

  • Logs: Check storage/logs/laravel.log for PanicHD-related errors.
  • SQL Queries: Use DB::enableQueryLog() to inspect complex filter queries.
  • Event Debugging: Listen for events in app/Providers/EventServiceProvider.php:
    protected $listen = [
        \PanicHD\Events\TicketCreated::class => [
            \App\Listeners\LogTicketCreation::class,
        ],
    ];
    

Extension Points

  1. Custom Actions:

    • Extend the Ticket model to add methods:
      public function resolve()
      {
          // Custom logic (e.g., auto-close after 7 days)
          $this->status = 'resolved';
          $this->save();
      }
      
  2. Webhooks:

    • Listen for ticket.* events to trigger external actions (e.g., Slack notifications):
      \PanicHD\Events\TicketUpdated::class => function ($event) {
          // Send webhook to Slack
      };
      
  3. Middleware:

    • Restrict access to tickets via middleware:
      Route::middleware(['auth', 'can:view,ticket'])->group(function () {
          // Ticket routes
      });
      
  4. Testing:

    • Use PanicHD\Tests\CreatesApplication trait for unit tests:
      use PanicHD\Tests\CreatesApplication;
      class TicketTest extends TestCase {
          use CreatesApplication;
          // ...
      }
      
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.
daikazu/eloquent-salesforce-objects
unseen-codes/chat
romalytar/yammi-jobs-monitoring-laravel
kisame76/filament-db-table-state
nqxcode/laravel-lucene-search
dpfx/laravel-livewire-wizards
workos/workos-php-laravel
sofa/laravel-global-scope
nawasara/auth-primitives
adhocrat-io/arkhe-main
make-dev/orca-harpoon
itsemon245/lamet
baks-dev/dashboard
amoifr/pickle-panther-bundle
make-dev/orca
dmstr/symfony-system-resources-bundle
dmstr/symfony-job-queue-bundle
dmstr/openapi-json-schema-bundle
dmstr/keycloak-security-bundle
dmstr/doctrine-audit-log-bundle