Hey, I got this database error. From what I understand laravel is looking for a main.staff table for no reason. However it doesn't exist because it shouldn't.
Code:
<?php
namespace App\Http\Controllers;
use App\Models\Ticket;
use Inertia\Inertia;
use Inertia\Response;
use Illuminate\Support\Facades\Auth;
class TicketController extends Controller {
/**
* Display the create ticket form.
*/
public function create(): Response
{
return Inertia::render('Tickets/Create');
}
/**
* Display the tickets list page
*
*/
public function tickets(): Response
{
return Inertia::render('Tickets/List');
}
/**
* Display the user's tickets from the database.
*
*/
public function index(): Response
{
return Inertia::render('Tickets/List', [
'tickets' => Ticket::where('user_id', Auth::id())->get(),
]);
}
/**
* Store a new ticket in the database.
*/
public function store() {
$ticket = Ticket::create(
[
'title' => request('title'),
'description' => request('description'),
'user_id' => Auth::id(),
'category_id' => request('category_id'),
]);
}
}
Environment
Laravel Version 11.19.0
Php Version 8.3.8
Composer Version 2.7.7
Environment local