<?php

namespace App\Repositories;

use App\Models\City;
use App\Models\SpecializationMapping;
use App\Repositories\Interfaces\Doctorinterface;
use App\Repositories\Interfaces\Enqueryinterface;
use App\Traits\FileUploadTrait;
use Illuminate\Http\Request;
use App\Models\Enquery;
use Log;

class EnqueryRepository implements Enqueryinterface
{

    use FileUploadTrait;
    public function list()
    {

        $list = Enquery::select('id', "name", "subject",  'email', 'phone_number', 'enquery_for' ,'message')
            ->where('is_delete', 0)
            ->orderBy('id', 'desc') // Order by id in descending order
            ->paginate(10);

        return $list;

    }












    public function delete($id)
    {
        $city = Enquery::find($id);

        if (!$city) {
            return null; // or handle the case where doctor is not found
        }
        $city->update(['is_delete' => 1]);

        return $city;
    }

}
