Laravel app works fine locally but gives a errorexception Undefined variable $vendors after deploying on cPanel hosting

I have been hours at this and cannot get past this error which highlights the “@foreach ($vendors as $vendor)” line in the vendorapp.blade.php file.

The login (breeze) works fine and I can enter user credentials so I know the database is working fine. Somehow though the vendorapp blade doesn’t seem to use the vendorapp controller. When I change the vendorapp.blade.php file to only display $vendoritems, it gives the same error (undefined variable $vendoritems).
To also test that the controller is not used by the blade file, I can enter any rubbish (like “haha”) in the controller without it throwing an error.

The route is web.php:

<?php

use IlluminateSupportFacadesRoute;

Route::view('/', 'welcome')
    ->middleware(['auth', 'verified'])
    ->name('welcome');

require __DIR__.'/auth.php';

The welcome.php file is below:

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <title>Vendor</title>

        <!-- Fonts -->
        <link rel="preconnect" href="https://fonts.bunny.net">
        <link href="https://fonts.bunny.net/css?family=figtree:400,600&display=swap" rel="stylesheet" />

        <!-- Styles -->
        <script src="https://cdn.tailwindcss.com"></script>
        @vite(['resources/css/app.css', 'resources/js/app.js'])
    </head>
    <body class="antialiased font-sans">
        @livewire('vendorapp')
    </body>
</html>

The vendorapp.php controller:

<?php

namespace AppLivewire;

use AppModelsVendorItem;
use AppModelsVendor;
use LivewireComponent;
use AppLivewireActionsLogout;
use LivewireWithPagination;

class VendorApp extends Component
{
    use WithPagination;

    public $perPage = 25;
    public $search = '';
    public $sortDirection = 'ASC';
    public $sortColumn = 'price';
    public $filter = [];
    public $filterInStockSydney;
    public $filterInStockOther;
    private $vendoritems = [];

    /**
     * Log the current user out of the application.
     */
    public function logout(Logout $logout): void
    {
        $logout();

        $this->redirect('/', navigate: true);
    }


    public function doSort($column)
    {
        if($this->sortColumn == $column) {
            if ($this->sortDirection == "ASC") {
                $this->sortDirection = "DESC";
            }else{
                $this->sortDirection = "ASC";
            }
        }else{
            $this->sortColumn = $column;
            $this->sortDirection = "ASC";
        }
    }

    //lifecycle hooks
    // reset the page when there is an updated perpage field
    public function updatedPerPage(){
        $this->resetPage();
    }
    // reset when there is an updated search
    public function updatedSearch(){
        $this->resetPage();
    }

    public function render()
    {
        $vendoritems = VendorItem::search($this->search);
        if (!empty($this->filterInStockSydney)) {
            $vendoritems = $vendoritems->Where('in_stock_sydney',true);
        }
        if (!empty($this->filterInStockOther)) {
            $vendoritems = $vendoritems->Where('in_stock_other',true);
        }
        return view('livewire.vendorapp', 
            [
            'vendoritems' => $vendoritems->orderBy($this->sortColumn, $this->sortDirection)
                ->paginate($this->perPage),
            'vendors' => Vendor::orderBy('vendor','ASC')->get()
            ]
        );
    }
}

And the vendorapp.blade.php blade file:

)
<div>
    <section class="mt-10">
        <div class="md:flex">
            <div class="md:flex-shrink-0">
                <div class="mx-auto max-w-screen-xl px-4 lg:px-12">
                    <div class="bg-white dark:bg-gray-800 overflow-hidden">
                        <div class="flex items-center justify-between d p-4">
                            <div class="flex">
                                <div x-data="{ tooltip: false }">
                                    <div class="flex gap-10">
                                        <div>
                                            <input wire:model.live.debounce.300ms="search" type="text" class="bg-gray-50 border border-gray-300" placeholder="Search" required="">
                                        </div>
                                        <div>
                                            Stock Sydney: <input wire:model.live="filterInStockSydney" type="checkbox" class="bg-gray-50 border border-gray-300" required="">
                                        </div>
                                        <div>
                                            Stock Other: <input type="checkbox" wire:model.live="filterInStockOther" class="bg-gray-50 border border-gray-300" required="">
                                        </div>
                                        <div>
                                            <!-- this section is a tool tip popup -->
                                            <button x-on:click="tooltip = !tooltip">
                                            File dates
                                            </button>
                                                <div x-show="tooltip" class="z-50 x-50 absolute bg-white border-graphite border-2 rounded p-4 mt-1">
                                                    @foreach ($vendors as $vendor)
                                                        <tr class="border-b dark:border-gray-700">
                                                            <td class="px-4 py-3">
                                                                {{$vendor->vendor}} {{$vendor->refreshed}}<br>
                                                            </td>
                                                        </tr>
                                                    @endforeach
                                                </div>
                                        </div>
                                        <div>
                                            <label>Per Page</label>
                                            <select class="w-20" wire:model.live="perPage">
                                                <option value="10">10</option>
                                                <option value="25">25</option>
                                                <option value="50">50</option>
                                            </select>
                                        </div>
                                        <div>
                                            <button wire:click="logout" class="w-full text-start">
                                                <x-dropdown-link>
                                                    {{ __('Log Out') }}
                                                </x-dropdown-link>
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="overflow-x-auto">
                            <table class="w-full text-sm text-left text-gray-500">
                                <thead class="text-xs text-gray-700 uppercase">
                                    <tr>
                                        <th wire:click="doSort('vendor')" class="px-4 py-3">
                                            <x-sort-column :sortColumn="$sortColumn" :sortDirection="$sortDirection" columnName="vendor"/>
                                        </th>
                                        <th wire:click="doSort('item')" class="px-4 py-3">
                                            <x-sort-column :sortColumn="$sortColumn" :sortDirection="$sortDirection" columnName="item"/>
                                        </th>
                                        <th wire:click="doSort('manufacturer')" class="px-4 py-3">
                                            <x-sort-column :sortColumn="$sortColumn" :sortDirection="$sortDirection" columnName="manufacturer"/>
                                        </th>
                                        <th class="px-4 py-3">
                                            Description
                                        </th>
                                        <th wire:click="doSort('price')" class="px-4 py-3">
                                            <x-sort-column :sortColumn="$sortColumn" :sortDirection="$sortDirection" columnName="price"/>
                                        </th>
                                        <th class="px-4 py-3">
                                            Stock Sydney
                                        </th>
                                        <th class="px-4 py-3">
                                            Stock Other
                                        </th>
                                        <th class="px-4 py-3">
                                            ETA Sydney
                                        </th>
                                        <th class="px-4 py-3">
                                            ETA Other
                                        </th>
                                    </tr>
                                </thead>
                                <tbody>
                                    @foreach ($vendoritems as $vendoritem)
                                        <tr class="border-b dark:border-gray-700">
                                            <td class="px-4 py-3">
                                                {{$vendoritem->vendor}}
                                            </td>
                                            <td class="px-4 py-3">
                                                {!!$vendoritem->item!!}
                                            </td>
                                            <td class="px-4 py-3">
                                                {{$vendoritem->manufacturer}}
                                            </td>
                                            <td class="px-4 py-3">
                                                {{$vendoritem->description}}
                                            </td>
                                            <td class="px-4 py-3">
                                                {{$vendoritem->price}}
                                            </td>
                                            <td class="px-4 py-3">
                                                {{$vendoritem->stock_sydney}}
                                            </td>
                                            <td class="px-4 py-3">
                                                {{$vendoritem->stock_other}}
                                            </td>
                                            <td class="px-4 py-3">
                                                {{$vendoritem->eta_sydney}}
                                            </td>
                                            <td class="px-4 py-3">
                                                {{$vendoritem->eta_other}}
                                            </td>
                                        </tr>

                                    @endforeach
                                </tbody>
                            </table>
                        </div>

                        <div class="py-4 px-3">
                            {{$vendoritems->links()}}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>

I have looked at capitals of classes and tried with different options to no avail.

Any help would be great!

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật