From 15f469c38641a0485ac72f848d0f135f5ce5cde7 Mon Sep 17 00:00:00 2001 From: Cristopher Date: Thu, 21 Mar 2024 09:47:28 +0100 Subject: [PATCH] Set as a scope Laravel throws "invalid hash_id column" because it doesn't detect as a query builder, so we need to set it as a scope --- src/Hashidable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hashidable.php b/src/Hashidable.php index 5aeb9c6..1081334 100644 --- a/src/Hashidable.php +++ b/src/Hashidable.php @@ -37,7 +37,7 @@ public static function findByHashidOrFail(string $hash) * @param string $columnId By default 'id' but can be diferent some developers * @return \Illuminate\Database\Eloquent\Builder */ - public static function whereHashid(string $hash, string $columnId = 'id') + public static function scopeWhereHashid(string $hash, string $columnId = 'id') { $static = new static();