OwlCyberSecurity - MANAGER
Edit File: Product.php
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Relations\MorphOne; use Illuminate\Database\Eloquent\SoftDeletes; class Product extends Model { use SoftDeletes; protected $fillable = [ 'store_id', 'category_id', 'code', 'price', 'images', 'title', 'slug', 'price', 'shipping_cost', 'description', 'body', 'is_show', 'file_id', 'view_count', 'count', 'weight', 'min_delivery_period', 'max_delivery_period' ]; protected $casts = [ 'images' => 'array' ]; public function store(): BelongsTo { return $this->belongsTo(Store::class, 'store_id', 'id'); } public function category(): BelongsTo { return $this->belongsTo(ProductCategory::class, 'category_id', 'id'); } public function thumbnail(): BelongsTo { return $this->belongsTo(File::class, 'file_id'); } public function seo(): MorphOne { return $this->morphOne(Seo::class, 'seoable'); } }