<?php

namespace App\Http\Controllers;

use Illuminate\Support\Facades\Route;

use Illuminate\Http\Request;
use App\Models\Client;
use App\Models\Customer;

class CustomerController extends Controller
{

    public function customers(Request $request, Client $patient){
       $customers = Customer::where('client_id', $patient->id)->paginate(25);
        return view('app.patient.company-client.customers', compact('patient', 'customers'));
    }

    public function customersList(Request $request, Client $patient){
        $customers = Customer::where('client_id', $patient->id)->paginate(25);
         return view('app.patient.company-client.customers', compact('patient', 'customers'));
     }

    public function customer(Request $request, Client $patient, $slug){
        $customer = Customer::where('slug', $slug)->first();
         return view('app.patient.company-client.customer', compact('patient', 'customer'));
     } 

}
