"boolean", ]; public static function hasProductIdColumn(): bool { if (static::$productIdColumnExists !== null) { return static::$productIdColumnExists; } try { static::$productIdColumnExists = \Illuminate\Support\Facades\Schema::hasColumn( (new static)->getTable(), 'product_id' ); } catch (\Throwable) { static::$productIdColumnExists = false; } return static::$productIdColumnExists; } public function customer() { return $this->belongsTo(Customer::class); } public function product() { return $this->belongsTo(Product::class); } }