fritsjan's avatar

ticketing for laravel?

Hi All,

I am developing a dashboard in laravel (inertia, vue) and would like my users to be able to give me feedback. A simple message system would be enough for now, but bug reports or feature requests or support would be nice in the future.

An integrated ticketing system would be nice. This might be an option but has been updated 3 years ago: https://github.com/coderflexx/laravel-ticket

Any recommendations for integrated or external message/ticketing system?

0 likes
1 reply
LaryAI's avatar
Level 58

Certainly! Here are some options and recommendations for adding a ticketing/feedback system to your Laravel (Inertia + Vue) dashboard:


1. Building a Simple Custom Ticketing System

Since your current need is quite basic (messages/feedback), you might want to start small and iterate. Here’s a simple approach you can expand on later:

a) Migration Example

// database/migrations/xxxx_xx_xx_create_tickets_table.php
Schema::create('tickets', function (Blueprint $table) {
    $table->id();
    $table->foreignId('user_id')->constrained()->onDelete('cascade');
    $table->string('type')->default('message'); // message, bug, feature, support, etc.
    $table->string('subject');
    $table->text('message');
    $table->timestamps();
});

b) Eloquent Model

class Ticket extends Model
{
    protected $fillable = ['user_id', 'type', 'subject', 'message'];

    public function user()
    {
        return $this->belongsTo(User::class);
    }
}

c) Basic Controller (for Inertia/Vue)

class TicketController extends Controller
{
    public function index()
    {
        return Inertia::render('Tickets/Index', [
            'tickets' => Ticket::where('user_id', auth()->id())->get(),
        ]);
    }

    public function store(Request $request)
    {
        $data = $request->validate([
            'type' => 'required|string',
            'subject' => 'required|string|max:255',
            'message' => 'required|string',
        ]);

        auth()->user()->tickets()->create($data);

        return redirect()->back()->with('success', 'Feedback submitted!');
    }
}

d) Vue Component Example

A simple form for submitting feedback/tickets:

<template>
  <form @submit.prevent="submit">
    <select v-model="form.type">
      <option value="message">Message</option>
      <option value="bug">Bug Report</option>
      <option value="feature">Feature Request</option>
      <option value="support">Support</option>
    </select>
    <input v-model="form.subject" placeholder="Subject" required />
    <textarea v-model="form.message" placeholder="Your message" required />
    <button type="submit">Send</button>
  </form>
</template>

<script setup>
import { reactive } from 'vue'
import { useForm } from '@inertiajs/vue3'

const form = useForm({
  type: 'message',
  subject: '',
  message: '',
})

function submit() {
  form.post('/tickets')
}
</script>

2. Using Existing Packages

  • coderflexx/laravel-ticket: While it’s not very recently updated, it might still work, especially with basic needs. If you use it, test carefully and consider forking/updating for your Laravel version.
  • Spatie and Other Vendors: As of now, there isn’t a big, widely-used open-source ticket system package for Laravel. Most robust solutions are SaaS or standalone apps.

3. External/SaaS Integrations (For Future Needs)

If you need something more advanced or want to avoid maintenance:


Recommendation:
Start with a lightweight internal system as sketched above. This keeps user feedback easy to manage and gives flexibility. Later, you can either evolve this or migrate to an external system once your needs outgrow it.

Let me know if you need full code examples or more advanced workflow (such as replies, admin dashboard, etc)!

1 like

Please or to participate in this conversation.