<?php

namespace App\Http\Controllers;

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

class ClintController extends Controller
{
    // ClientController.php
    public function search(Request $request) {
        $mobile = $request->input('mobile');

        // Find clients where the mobile number partially matches the input
        $clients = Client::where('mobile', 'like', "%{$mobile}%")->get();

        return response()->json($clients);
    }

    public function list()
    {
        return view('admin.clint.index', [
            'client' => Client::all()
        ]);
    }
}
