summaryrefslogtreecommitdiff
path: root/workbench/app/Models/Product.php
diff options
context:
space:
mode:
authorSam Light <samlight1994@gmail.com>2025-04-26 12:25:03 +0100
committerSam Light <samlight1994@gmail.com>2025-04-26 12:25:03 +0100
commit88f71aeba1a1649661d713297d3a75454636b2d1 (patch)
tree9f37fb5bbcd22930dd5e7686958614abf2a970d0 /workbench/app/Models/Product.php
parenta1ba375df4978a606d519430ce8f7c7f0d170eed (diff)
Larastan fixes
Diffstat (limited to 'workbench/app/Models/Product.php')
-rw-r--r--workbench/app/Models/Product.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/workbench/app/Models/Product.php b/workbench/app/Models/Product.php
index 1edb185..cf9892e 100644
--- a/workbench/app/Models/Product.php
+++ b/workbench/app/Models/Product.php
@@ -2,6 +2,8 @@
namespace Workbench\App\Models;
+use Workbench\Database\Factories\ProductFactory;
+
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
@@ -9,13 +11,23 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Product extends Model
{
+
+ /**
+ * @use HasFactory<ProductFactory>
+ */
use HasFactory;
- protected static function newFactory()
+ /**
+ * @return ProductFactory<static>
+ */
+ protected static function newFactory(): ProductFactory
{
- return \Workbench\Database\Factories\ProductFactory::new();
+ return ProductFactory::new();
}
+ /**
+ * @param Builder<static> $q
+ */
public function scopeSearch(Builder $q, string $s): void
{
$s = "%{$s}%";
@@ -25,6 +37,9 @@ class Product extends Model
));
}
+ /**
+ * @return BelongsTo<Category, $this>
+ */
public function category(): BelongsTo
{
return $this->belongsTo(Category::class);