Support the ongoing development of Laravel.io →
posted 5 years ago

I am making a query to know if a certain uuid exists, but it returns an error. I am using Postgres.

public function show($uuid) { if(!$tenant = Tenant::where('uuid',$uuid)->first()){ return response()->json(['message' => 'Not found'],404); } return new TenantResources($tenant); }

Error: Illuminate\Database\QueryException: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type uuid: "7c39dfa2-c5f5-4b16-839e-fdb0562790600" (SQL: select * from "tenants" where "uuid" = 7c39dfa2-c5f5-4b16-839e-fdb0562790600 and "tenants"."deleted_at" is null limit 1)

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.