Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

madprabh's avatar

7 ERROR: invalid input syntax for type bigint: "create" - strange error

Hey Everyone,

I am facing a very strange situation. So I have this route

/threads/create

In my web.php I have

Route::get('/threads/create', [ThreadController::class, 'create'])->name('threads.create');

In my controller "ThreadController"

public function create()
    {
        //
        try {
            return Inertia::render('Community/Partials/CreateThreadForm');
        }
        catch (\Exception $e)
        {
            return $e->getMessage();
        }
    }

Until sometime ago it was working perfectly fine and now suddenly I see the following error

SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type bigint: "create" CONTEXT: unnamed portal parameter  = '...'

I am baffled. Its just a simple create form for a thread, there is absolutely no DB query as such and I get that error. I am using Jetstream with Inertia+vue stack

anyone know what might be the problem....?

0 likes
2 replies
SilenceBringer's avatar
Level 55

@madprabh it looks like the problem with the routes. It trying to parse create as id param for show method

Route::get('/threads/{thread}', ...

try to move routes for view and create visa-versa (routes order is important)

Please or to participate in this conversation.