<?php

namespace App\Http\Controllers;

use App\Models\Carmodel;
use Auth, DB, Mail, Validator, File, DataTables;
use Illuminate\Http\Request;
use App\Models\Vendor;


class VendorDashboardController extends Controller{

    public function index(Request $request){
        $vendor = Vendor::find(auth()->id());
        return view('vendordashboard', ['vendor' => $vendor]);
    }
    
    
    public function profileview(Request $request)
    {
        $vendor = Vendor::find(auth()->id());
    
        if (!$vendor) {
            return redirect()->route('vendordashboard')->with('error', 'Vendor not found');
        }
    
        return view('vendor.profile', ['vendor' => $vendor]);
    }
    


    

    }
    

    
