VendorHive Documentation

Complete Multi-Vendor Marketplace Package for Laravel โ€” Installation, Configuration & Usage Guide

๐Ÿ“ฆ Composer Package โœ… Laravel 10 / 11 / 12 ๐Ÿงฉ PHP 8.1+ โšก 130+ Files

๐Ÿ“‹ Introduction

What is VendorHive and what does it offer?

VendorHive is a production-ready, reusable Laravel package that adds a complete multi-vendor marketplace to any Laravel application. Install it via Composer and you instantly get:

๐Ÿข

Admin Panel

Full dashboard with vendor management, product approval, order tracking, reports, coupons, CMS pages & system settings.

๐Ÿช

Vendor Panel

Vendors manage their shop, products, orders, commissions, withdrawals & reviews from their own dashboard.

๐Ÿ›๏ธ

Customer Storefront

Product browsing, search, cart, checkout, wishlist, order tracking, reviews & customer profile.

๐Ÿ’ฐ

Commission System

Automatic commission calculation with vendor-specific rates, global defaults, and vendor balance tracking.

๐Ÿ”

Role-Based Auth

Admin, Vendor & Customer roles with dedicated middleware. Configurable guard & user model.

๐Ÿ”Œ

REST API

Built-in API endpoints for products, categories, authentication & user profile.

โš™๏ธ Requirements

System requirements before installing VendorHive.

RequirementVersion
PHP8.1 or higher
Laravel10.x, 11.x, or 12.x
Composer2.x
DatabaseMySQL 5.7+ / PostgreSQL 10+ / SQLite 3.8+

๐Ÿ“ฆ Installation

Step-by-step guide to install VendorHive in your Laravel project.

1

Install via Composer

If the package is published on Packagist:

composer require gambolthemes/vendorhive

If using a local path or private repository, first add the repository to your project's composer.json:

// composer.json (your Laravel project)
{
    "repositories": [
        {
            "type": "path",
            "url": "../VendorHive"
        }
    ]
}

Then install:

composer require gambolthemes/vendorhive:@dev
โ„น๏ธ
The package uses Laravel Auto-Discovery, so the ServiceProvider is registered automatically. No manual registration needed!
2

Publish the Config File

php artisan vendor:publish --tag=vendorhive-config

This creates config/vendorhive.php where you can customize all settings.

3

Add Role Column to Users Table

Create a migration to add role and phone columns to your users table:

php artisan make:migration add_role_to_users_table --table=users

Edit the generated migration:

public function up(): void
{
    Schema::table('users', function (Blueprint $table) {
        $table->enum('role', ['admin', 'vendor', 'customer'])
              ->default('customer')
              ->after('email');
        $table->string('phone')->nullable()->after('role');
    });
}

public function down(): void
{
    Schema::table('users', function (Blueprint $table) {
        $table->dropColumn(['role', 'phone']);
    });
}
4

Setup Your User Model

Add the VendorHiveUser trait to your App\Models\User model:

namespace App\Models;

use Gambolthemes\VendorHive\Traits\VendorHiveUser;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use HasFactory, Notifiable, VendorHiveUser;

    protected $fillable = [
        'name', 'email', 'password', 'role', 'phone',
    ];
}

Then update config/vendorhive.php to point to your User model:

'user_model' => \App\Models\User::class,
โš ๏ธ
This step is critical. If you skip this, the package will use its own internal User model which may not match your users table structure.
5

Run Migrations

php artisan migrate

This creates 14 package tables + your role migration: categories, vendors, shops, products, coupons, orders, order_items, payments, commissions, withdrawals, reviews, wishlists, pages, settings.

6

Seed Default Data

# Create demo users (admin/vendor/customer with password: 12345678)
php artisan db:seed --class="Gambolthemes\VendorHive\Database\Seeders\AdminSeeder"

# Create 6 categories with 30 subcategories
php artisan db:seed --class="Gambolthemes\VendorHive\Database\Seeders\CategorySeeder"

# Create 23 default settings
php artisan db:seed --class="Gambolthemes\VendorHive\Database\Seeders\SettingSeeder"
7

Remove Default Welcome Route

VendorHive registers its own / (homepage) route. If your routes/web.php has the default Laravel welcome route, remove it or comment it out:

// routes/web.php

// Remove or comment out this line:
// Route::get('/', function () { return view('welcome'); });

// VendorHive handles all routes via the package
8

Start the Server ๐ŸŽ‰

php artisan serve

Visit http://127.0.0.1:8000 โ€” Your marketplace is now live!

๐Ÿš€ Quick Start (Copy & Paste)

All commands in one block โ€” paste into your terminal:

# 1. Install package
composer require gambolthemes/vendorhive

# 2. Publish config
php artisan vendor:publish --tag=vendorhive-config

# 3. Create role migration
php artisan make:migration add_role_to_users_table --table=users
# โ†‘ Edit this migration (see Step 3 above), then:

# 4. Run migrations
php artisan migrate

# 5. Seed data
php artisan db:seed --class="Gambolthemes\VendorHive\Database\Seeders\AdminSeeder"
php artisan db:seed --class="Gambolthemes\VendorHive\Database\Seeders\CategorySeeder"
php artisan db:seed --class="Gambolthemes\VendorHive\Database\Seeders\SettingSeeder"

# 6. Start server
php artisan serve
โœ…
Don't forget: Edit your User model to add the VendorHiveUser trait and update config/vendorhive.php with 'user_model' => \App\Models\User::class.

๐Ÿ’ณ Payment Setup & QA

Recommended steps to configure gateways and quickly verify end-to-end payment flow.

1

Configure Gateways in Admin Panel

Open /admin/settings โ†’ Payment tab and enable required gateways:

  • COD for cash orders
  • Stripe with stripe_key and stripe_secret
  • PayPal with paypal_client_id, paypal_secret, and paypal_mode (sandbox/live)
  • Razorpay with razorpay_key and razorpay_secret
2

Understand Verification Behavior

For non-COD methods, payment is marked paid only after server-side gateway verification (transaction ID, amount, status, currency checks).

โš ๏ธ
Use real/sandbox gateway transaction IDs in the payment screen. Invalid IDs are rejected.
3

Vendor Withdrawal Payout Setup

Vendor must configure payout details at /vendor/shop before withdrawing:

  • PayPal: paypal_email
  • Bank: bank_name + bank_account_number (routing/IFSC optional)
๐Ÿงช
Run complete smoke test using PAYMENT_FLOW_QA_CHECKLIST.txt in repository root.

๐Ÿ”ง Configuration

Full reference of all options in config/vendorhive.php

KeyDefaultDescription
route_prefix''URL prefix for all routes. Set to 'marketplace' to serve from /marketplace/...
admin_prefix'admin'URL prefix for admin panel routes
vendor_prefix'vendor'URL prefix for vendor panel routes
commission_percentage10Default global commission % deducted from vendor earnings
currency'USD'Currency code used for display
currency_symbol'$'Currency symbol shown before prices
withdrawal_minimum50Minimum vendor balance required to request a withdrawal
enable_product_approvaltrueRequire admin approval for new vendor products
vendor_auto_approvefalseAutomatically approve new vendor registrations
user_modelVendorHive\Models\UserYour app's User model class (override with App\Models\User::class)
guard'web'Auth guard used for VendorHive routes
middleware(array)Middleware groups for web, auth, admin, vendor, customer, guest, api routes
layouts(array)Blade layout views for app, admin, vendor panels
payments.codtrueEnable Cash on Delivery
payments.stripefalseEnable Stripe payment gateway
payments.paypalfalseEnable PayPal payment gateway
payments.razorpayfalseEnable Razorpay payment gateway

Middleware Configuration

'middleware' => [
    'web'      => ['web'],
    'auth'     => ['web', 'auth'],
    'admin'    => ['web', 'auth', 'vendorhive.admin'],
    'vendor'   => ['web', 'auth', 'vendorhive.vendor'],
    'customer' => ['web', 'auth', 'vendorhive.customer'],
    'guest'    => ['web', 'guest'],
    'api'      => ['api'],
],

๐Ÿ‘ค User Model Setup

How to integrate VendorHive with your existing User model.

The VendorHiveUser Trait

The VendorHiveUser trait adds role helpers and marketplace relationships to your User model:

MethodReturnDescription
isAdmin()boolReturns true if user role is 'admin'
isVendor()boolReturns true if user role is 'vendor'
isCustomer()boolReturns true if user role is 'customer'
vendor()HasOneVendor profile relationship
orders()HasManyCustomer orders
reviews()HasManyProduct reviews by this user
wishlists()HasManyWishlist items
payments()HasManyPayment records

User Roles

VendorHive uses 3 roles stored in the role column of the users table:

๐Ÿ”ด

admin

Full access to admin panel โ€” manage vendors, products, orders, settings, reports.

๐ŸŸก

vendor

Manage their own shop, products, orders, commissions, and withdrawals.

๐ŸŸข

customer

Browse products, place orders, leave reviews, manage wishlist and profile. Default role for new registrations.

๐Ÿ›ก๏ธ Middleware

VendorHive registers 3 middleware aliases automatically.

AliasClassAction
vendorhive.adminAdminMiddlewareAllows only users with role = 'admin'. Redirects others to login.
vendorhive.vendorVendorMiddlewareAllows only users with role = 'vendor'. Redirects others to login.
vendorhive.customerCustomerMiddlewareAllows only users with role = 'customer'. Redirects others to login.

๐Ÿข Admin Panel

All admin features accessible at /admin/dashboard

๐Ÿ“Š

Dashboard

Overview stats โ€” total orders, revenue, vendors, products, recent orders.

๐Ÿ‘ฅ

Vendor Management

View, approve, reject, suspend vendors. Set per-vendor commission rates.

๐Ÿ“ฆ

Product Management

View all products, approve/reject pending products, delete products.

๐Ÿ—‚๏ธ

Category Management

Full CRUD for categories with parent/child hierarchy.

๐Ÿงพ

Order Management

View all orders, update order status.

๐Ÿท๏ธ

Coupon Management

Create percentage/fixed-value coupons with date ranges and usage limits.

๐Ÿ“„

CMS Pages

Create custom pages (About, Terms, Privacy, etc.) with Markdown/HTML.

๐Ÿ’ธ

Withdraw Requests

Approve, reject, or complete vendor withdrawal requests.

๐Ÿ“ˆ

Reports

Sales reports & vendor earnings reports with date filtering.

โš™๏ธ

Settings

General, commission & payment settings stored in database.

Admin URLs

PageURL
Admin Login/admin/login
Dashboard/admin/dashboard
Vendors/admin/vendors
Products/admin/products
Categories/admin/categories
Orders/admin/orders
Coupons/admin/coupons
Pages/admin/pages
Withdrawals/admin/withdrawals
Sales Report/admin/reports/sales
Vendor Earnings/admin/reports/vendor-earnings
Settings/admin/settings

๐Ÿช Vendor Panel

Vendor dashboard accessible at /vendor/dashboard

Vendor Registration Flow

  1. User visits /vendor/register and fills the registration form
  2. If vendor_auto_approve is false (default), vendor status is set to pending
  3. Vendor sees the /vendor/pending page until admin approves
  4. Admin approves from /admin/vendors โ†’ vendor can now access dashboard

Vendor URLs

PageURL
Register as Vendor/vendor/register
Pending Approval/vendor/pending
Dashboard/vendor/dashboard
Shop Settings/vendor/shop
Products (CRUD)/vendor/products
Orders/vendor/orders
Commissions/vendor/commissions
Withdrawals/vendor/withdrawals
Reviews/vendor/reviews

๐Ÿ›๏ธ Frontend / Storefront

Customer-facing pages.

Public URLs (No Login Required)

PageURL
Homepage/
All Products/products
Product Detail/products/{slug}
Category/category/{slug}
Vendor Shop/shop/{slug}
CMS Page/page/{slug}
Cart/cart
Login/login
Register/register

Customer URLs (Login Required)

PageURL
Customer Dashboard/customer/dashboard
My Orders/customer/orders
Order Detail/customer/orders/{orderNumber}
Profile/customer/profile
Wishlist/customer/wishlist
Checkout/checkout

๐Ÿ“Š Models Reference

15 Eloquent models included in the package.

ModelTableKey FieldsRelationships
Categorycategoriesname, slug, parent_id, is_activeparent, children, products
Vendorvendorsuser_id, business_name, slug, status, balance, commission_rateuser, shop, products, orderItems, commissions, withdrawals
Shopshopsvendor_id, name, slug, logo, bannervendor
Productproductsvendor_id, category_id, name, slug, price, statusvendor, category, orderItems, reviews, wishlists
Orderordersorder_number, user_id, total, status, payment_statususer, items, payments, commissions, coupon
OrderItemorder_itemsorder_id, product_id, vendor_id, price, quantityorder, product, vendor, commission
Paymentpaymentsorder_id, user_id, payment_method, amount, statusorder, user
Commissioncommissionsorder_id, vendor_id, commission_amount, vendor_earningorder, orderItem, vendor
Withdrawalwithdrawalsvendor_id, amount, method, statusvendor
Reviewreviewsuser_id, product_id, vendor_id, rating, commentuser, product, vendor
Couponcouponscode, type, value, start_date, end_datevendor, orders
Wishlistwishlistsuser_id, product_iduser, product
Pagepagestitle, slug, content, is_activeโ€”
Settingsettingskey, value, groupโ€”
Userusersname, email, role, phonevendor, orders, reviews, wishlists, payments

Using Models in Your Code

use Gambolthemes\VendorHive\Models\Product;
use Gambolthemes\VendorHive\Models\Category;
use Gambolthemes\VendorHive\Models\Order;
use Gambolthemes\VendorHive\Models\Vendor;

// Get all active products
$products = Product::active()->get();

// Get featured products
$featured = Product::featured()->take(8)->get();

// Get active categories with children
$categories = Category::active()->parents()->with('children')->get();

// Check if a user is a vendor
if ($user->isVendor()) {
    $shop = $user->vendor->shop;
}

๐ŸŒฑ Seeders

3 built-in seeders to bootstrap your marketplace data.

๐Ÿ”‘ AdminSeeder

Creates default demo users:

  • Admin: admin@vendorhive.com / 12345678
  • Vendor: vendor@vendorhive.com / 12345678
  • Customer: customer@vendorhive.com / 12345678
php artisan db:seed --class="Gambolthemes\VendorHive\Database\Seeders\AdminSeeder"
๐Ÿ“‚ CategorySeeder

Creates 6 parent categories, each with 5 subcategories (36 total):

  • Electronics โ€” Smartphones, Laptops, Audio, Cameras, Wearables
  • Fashion โ€” Men's, Women's, Shoes, Bags, Jewelry
  • Home & Garden โ€” Furniture, Kitchen, Bedding, Garden, Decor
  • Sports & Outdoors โ€” Fitness, Outdoor, Team Sports, Cycling, Camping
  • Books & Media โ€” Fiction, Non-Fiction, Textbooks, Music, Movies
  • Health & Beauty โ€” Skincare, Haircare, Makeup, Personal Care, Vitamins
php artisan db:seed --class="Gambolthemes\VendorHive\Database\Seeders\CategorySeeder"
โš™๏ธ SettingSeeder

Creates 23 default settings across 5 groups: general, commission, vendor, payment, seo.

php artisan db:seed --class="Gambolthemes\VendorHive\Database\Seeders\SettingSeeder"

๐Ÿ”€ Routes Reference

All 105+ web routes registered by VendorHive. All route names use the vendorhive. prefix.

Public Routes

MethodURIRoute NameController
GET/vendorhive.homeHomeController@index
GET/productsvendorhive.products.indexProductController@index
GET/products/{slug}vendorhive.products.showProductController@show
GET/category/{slug}vendorhive.category.showProductController@category
GET/shop/{slug}vendorhive.shop.showShopController@show
GET/page/{slug}vendorhive.page.showPageController@show

Cart Routes

MethodURIRoute Name
GET/cartvendorhive.cart.index
POST/cart/addvendorhive.cart.add
POST/cart/updatevendorhive.cart.update
POST/cart/removevendorhive.cart.remove
POST/cart/clearvendorhive.cart.clear

Authentication Routes

MethodURIRoute Name
GET/loginvendorhive.login
POST/loginvendorhive.login.submit
GET/registervendorhive.register
POST/registervendorhive.register.submit
GET/vendor/registervendorhive.vendor.register
POST/vendor/registervendorhive.vendor.register.submit
GET/admin/loginvendorhive.admin.login
POST/admin/loginvendorhive.admin.login.submit
POST/logoutvendorhive.logout
GET/forgot-passwordvendorhive.password.request
POST/forgot-passwordvendorhive.password.email
GET/reset-password/{token}vendorhive.password.reset
POST/reset-passwordvendorhive.password.update

Customer Routes (requires login + customer role)

MethodURIRoute Name
GET/customer/dashboardvendorhive.customer.dashboard
GET/customer/ordersvendorhive.customer.orders
GET/customer/orders/{num}vendorhive.customer.orders.show
GET/customer/profilevendorhive.customer.profile
POST/customer/profilevendorhive.customer.profile.update
GET/customer/wishlistvendorhive.customer.wishlist
POST/customer/wishlist/togglevendorhive.customer.wishlist.toggle

Vendor Routes (requires login + vendor role + approved)

MethodURIRoute Name
GET/vendor/dashboardvendorhive.vendor.dashboard
GET/vendor/shopvendorhive.vendor.shop.edit
POST/vendor/shopvendorhive.vendor.shop.update
GET/vendor/productsvendorhive.vendor.products.index
GET/vendor/products/createvendorhive.vendor.products.create
POST/vendor/productsvendorhive.vendor.products.store
GET/vendor/products/{id}/editvendorhive.vendor.products.edit
PUT/vendor/products/{id}vendorhive.vendor.products.update
DEL/vendor/products/{id}vendorhive.vendor.products.destroy
GET/vendor/ordersvendorhive.vendor.orders.index
GET/vendor/orders/{item}vendorhive.vendor.orders.show
POST/vendor/orders/{item}/statusvendorhive.vendor.orders.updateStatus
GET/vendor/commissionsvendorhive.vendor.commissions.index
GET/vendor/withdrawalsvendorhive.vendor.withdrawals.index
POST/vendor/withdrawalsvendorhive.vendor.withdrawals.store
GET/vendor/reviewsvendorhive.vendor.reviews.index

Admin Routes (requires login + admin role)

Admin has 40+ routes for dashboard, vendors, products, categories, orders, coupons, pages, settings, withdrawals, and reports. All prefixed with /admin/ and named vendorhive.admin.*.

See the Admin Panel section for all URLs.

๐Ÿ”Œ REST API

Built-in API endpoints at /api/v1/vendorhive/

Public API Endpoints

MethodURIRoute NameDescription
POST/api/v1/vendorhive/registervendorhive.api.registerRegister a new user
POST/api/v1/vendorhive/loginvendorhive.api.loginLogin & get token
GET/api/v1/vendorhive/productsvendorhive.api.products.indexList all products
GET/api/v1/vendorhive/products/{slug}vendorhive.api.products.showSingle product detail
GET/api/v1/vendorhive/categoriesvendorhive.api.categoriesList all categories

Authenticated API Endpoints (requires auth:sanctum)

MethodURIRoute NameDescription
POST/api/v1/vendorhive/logoutvendorhive.api.logoutRevoke token / logout
GET/api/v1/vendorhive/profilevendorhive.api.profileGet user profile
GET/api/v1/vendorhive/uservendorhive.api.userGet authenticated user
โ„น๏ธ
To use authenticated API endpoints, install laravel/sanctum and add the HasApiTokens trait to your User model.

๐Ÿ’ฐ Commission System

How VendorHive calculates and manages commissions.

Commission Rate Priority

  1. Vendor-specific rate โ€” set per vendor via admin panel (vendors.commission_rate column)
  2. Database setting โ€” Setting::getValue('global_commission_rate')
  3. Config fallback โ€” config('vendorhive.commission_percentage', 10)

How It Works

// Example: Product sold for $100, commission rate = 10%

Commission Amount = $100 ร— 10% = $10     // platform keeps
Vendor Earning    = $100 - $10  = $90     // vendor gets

// Commission record created automatically when order is placed
// Vendor balance updated when admin marks commission as completed

CommissionService Methods

MethodDescription
calculate(Vendor, float)Returns array with rate, commission amount, vendor earning
getCommissionRate(Vendor)Gets effective rate using the 3-tier priority
createCommissionRecord(Order, OrderItem, Vendor)Creates a pending commission record
creditVendorsForOrder(Order)Marks commissions as completed, credits vendor balance
refundCommissionsForOrder(Order)Marks commissions as refunded, debits vendor balance

Using CommissionService in Your Code

use Gambolthemes\VendorHive\Services\CommissionService;

$service = app(CommissionService::class);

// Calculate commission for a vendor on $100 order
$result = $service->calculate($vendor, 100.00);
// Returns: ['rate' => 10, 'commission' => 10.00, 'vendor_earning' => 90.00]

๐Ÿงฐ Helpers

Static helper methods available via VendorHiveHelper.

use Gambolthemes\VendorHive\Helpers\VendorHiveHelper;
MethodReturnsDescription
VendorHiveHelper::setting($key, $default)mixedGet a setting value from the database
VendorHiveHelper::formatPrice($amount)stringFormat a price with currency symbol (e.g., $99.00)
VendorHiveHelper::currency()stringGet currency code (e.g., USD)
VendorHiveHelper::requiresProductApproval()boolCheck if products need admin approval
VendorHiveHelper::minimumWithdrawal()floatGet minimum withdrawal amount

Usage in Blade Views

{{-- Display formatted price --}}
{{ Gambolthemes\VendorHive\Helpers\VendorHiveHelper::formatPrice($product->price) }}

{{-- Get a setting --}}
{{ Gambolthemes\VendorHive\Helpers\VendorHiveHelper::setting('site_name', 'My Store') }}

๐ŸŽจ Customization

How to customize views, layouts, and routes.

Custom Views (Override Blade Templates)

Publish views to override them in your app:

php artisan vendor:publish --tag=vendorhive-views

This copies all views to resources/views/vendor/vendorhive/. Edit files there โ€” Laravel will use your overrides automatically.

Custom Layouts

Change the layout files used by VendorHive in config/vendorhive.php:

'layouts' => [
    'app'    => 'layouts.app',        // your app layout
    'admin'  => 'layouts.admin',      // your admin layout
    'vendor' => 'layouts.vendor',     // your vendor layout
],

Route Prefix

Serve VendorHive under a custom URL path:

// Serve marketplace under /marketplace/...
'route_prefix' => 'marketplace',

// Result: /marketplace/products, /marketplace/admin/dashboard, etc.

Currency

'currency'        => 'INR',
'currency_symbol' => 'โ‚น',

๐Ÿ“ค Publishing Assets

VendorHive supports 4 publish tags for customization.

TagCommandPublishes To
vendorhive-config php artisan vendor:publish --tag=vendorhive-config config/vendorhive.php
vendorhive-migrations php artisan vendor:publish --tag=vendorhive-migrations database/migrations/
vendorhive-views php artisan vendor:publish --tag=vendorhive-views resources/views/vendor/vendorhive/
vendorhive-seeders php artisan vendor:publish --tag=vendorhive-seeders database/seeders/
๐Ÿ’ก
Tip: You only need to publish the config file. Migrations run automatically from the package, and views can be overridden by publishing only when you need to customize them.

๐Ÿ“ File Structure

Complete package directory structure (133 files).

vendorhive/ โ”œโ”€โ”€ composer.json โ”œโ”€โ”€ README.md โ”œโ”€โ”€ LICENSE โ”œโ”€โ”€ documentation.html โ””โ”€โ”€ src/ โ”œโ”€โ”€ VendorHiveServiceProvider.php โ”œโ”€โ”€ config/ โ”‚ โ””โ”€โ”€ vendorhive.php โ”œโ”€โ”€ database/ โ”‚ โ”œโ”€โ”€ migrations/ (14 migration files) โ”‚ โ””โ”€โ”€ seeders/ โ”‚ โ”œโ”€โ”€ AdminSeeder.php โ”‚ โ”œโ”€โ”€ CategorySeeder.php โ”‚ โ””โ”€โ”€ SettingSeeder.php โ”œโ”€โ”€ Helpers/ โ”‚ โ””โ”€โ”€ VendorHiveHelper.php โ”œโ”€โ”€ Http/ โ”‚ โ”œโ”€โ”€ Controllers/ โ”‚ โ”‚ โ”œโ”€โ”€ Controller.php โ”‚ โ”‚ โ”œโ”€โ”€ Admin/ (10 controllers) โ”‚ โ”‚ โ”œโ”€โ”€ Api/ (2 controllers) โ”‚ โ”‚ โ”œโ”€โ”€ Auth/ (3 controllers) โ”‚ โ”‚ โ”œโ”€โ”€ Frontend/ (10 controllers) โ”‚ โ”‚ โ””โ”€โ”€ Vendor/ (7 controllers) โ”‚ โ””โ”€โ”€ Middleware/ โ”‚ โ”œโ”€โ”€ AdminMiddleware.php โ”‚ โ”œโ”€โ”€ VendorMiddleware.php โ”‚ โ””โ”€โ”€ CustomerMiddleware.php โ”œโ”€โ”€ Models/ (15 models) โ”‚ โ”œโ”€โ”€ Category.php โ”‚ โ”œโ”€โ”€ Commission.php โ”‚ โ”œโ”€โ”€ Coupon.php โ”‚ โ”œโ”€โ”€ Order.php โ”‚ โ”œโ”€โ”€ OrderItem.php โ”‚ โ”œโ”€โ”€ Page.php โ”‚ โ”œโ”€โ”€ Payment.php โ”‚ โ”œโ”€โ”€ Product.php โ”‚ โ”œโ”€โ”€ Review.php โ”‚ โ”œโ”€โ”€ Setting.php โ”‚ โ”œโ”€โ”€ Shop.php โ”‚ โ”œโ”€โ”€ User.php โ”‚ โ”œโ”€โ”€ Vendor.php โ”‚ โ”œโ”€โ”€ Wishlist.php โ”‚ โ””โ”€โ”€ Withdrawal.php โ”œโ”€โ”€ resources/views/ (~58 blade files) โ”‚ โ”œโ”€โ”€ layouts/ (app, admin, vendor) โ”‚ โ”œโ”€โ”€ auth/ (login, register, forgot-password...) โ”‚ โ”œโ”€โ”€ admin/ (dashboard, vendors, products, orders...) โ”‚ โ”œโ”€โ”€ vendor/ (dashboard, products, orders, shop...) โ”‚ โ”œโ”€โ”€ frontend/ (home, products, cart, checkout...) โ”‚ โ””โ”€โ”€ partials/ (product-card) โ”œโ”€โ”€ routes/ โ”‚ โ”œโ”€โ”€ web.php (105+ routes) โ”‚ โ””โ”€โ”€ api.php (8 routes) โ”œโ”€โ”€ Services/ โ”‚ โ”œโ”€โ”€ CommissionService.php โ”‚ โ””โ”€โ”€ PaymentGatewayVerificationService.php โ””โ”€โ”€ Traits/ โ”œโ”€โ”€ VendorHiveUser.php โ””โ”€โ”€ HasVendorHiveRelations.php

๐Ÿ” Troubleshooting

Common issues and their solutions.

โŒ Route [vendorhive.home] not defined

Cause: Your app's routes/web.php has a Route::get('/', ...) that overrides the package's homepage route.

Fix: Remove or comment out the default / route in routes/web.php.

โŒ Class "Gambolthemes\VendorHive\..." not found

Cause: Composer autoload cache is outdated.

Fix: Run composer dump-autoload

โŒ Column "role" not found in users table

Cause: You haven't created the migration to add the role column.

Fix: Follow Installation Step 3 to create and run the role migration.

โŒ Trait "Laravel\Sanctum\HasApiTokens" not found

Cause: The package's internal User model references Sanctum which isn't installed.

Fix: Set 'user_model' => \App\Models\User::class in config/vendorhive.php so the package uses your app's User model instead.

โŒ Column "deleted_at" not found

Cause: The package's internal User model uses SoftDeletes but your users table lacks deleted_at.

Fix: Set 'user_model' => \App\Models\User::class in the config, and add the VendorHiveUser trait to your own User model.

โŒ Views not loading / layout errors

Fix: Clear view cache: php artisan view:clear

โŒ Package not discovered after composer require

Fix: Run php artisan package:discover or manually register the provider in bootstrap/providers.php (Laravel 11/12) or config/app.php (Laravel 10):

// Laravel 11/12: bootstrap/providers.php
return [
    Gambolthemes\VendorHive\VendorHiveServiceProvider::class,
];

// Laravel 10: config/app.php โ†’ 'providers' array
Gambolthemes\VendorHive\VendorHiveServiceProvider::class,
๐Ÿ”„ Clear All Caches
php artisan config:clear
php artisan route:clear
php artisan view:clear
php artisan cache:clear
composer dump-autoload

๐Ÿ”‘ Default Credentials

Login credentials created by the seeders.

๐Ÿ” Demo Logins
RoleURLEmailPassword
Admin/admin/loginadmin@vendorhive.com12345678
Vendor/loginvendor@vendorhive.com12345678
Customer/logincustomer@vendorhive.com12345678
โš ๏ธ
Important: Change the default admin password immediately after first login in a production environment!