Fix display of supplier products and offerings - wasnt including all services

This commit is contained in:
2023-03-15 15:34:28 +11:00
parent b719efb58c
commit a6f01d0864
5 changed files with 14 additions and 16 deletions

View File

@@ -4,7 +4,6 @@ namespace App\Http\Controllers;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use App\Http\Requests\{SupplierAddEdit,SupplierProductAddEdit};
use App\Models\{Cost,Supplier,SupplierDetail};

View File

@@ -6,7 +6,7 @@ use Illuminate\Support\Collection;
interface ProductItem
{
public function product();
public function products();
public function supplied();

View File

@@ -20,11 +20,11 @@ abstract class Type extends Model
/**
* The product that sells this type
*
* @return \Illuminate\Database\Eloquent\Relations\MorphOne
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
*/
public function product()
public function products()
{
return $this->morphOne(Product::class, null,'model','model_id');
return $this->morphMany(Product::class, null,'model','model_id');
}
/**