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)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community