![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/clinic.corals.io/app/Http/Controllers/Front/ |
<?php namespace App\Http\Controllers\Front; use App\Http\Controllers\Controller; use App\Models\ClinicSchedule; use App\Models\Doctor; use App\Models\Faq; use App\Models\FrontPatientTestimonial; use App\Models\Patient; use App\Models\Service; use App\Models\ServiceCategory; use App\Models\Setting; use App\Models\Slider; use App\Models\Specialization; use App\Models\User; use Illuminate\Contracts\Foundation\Application; use Illuminate\Contracts\View\Factory; use Illuminate\Contracts\View\View; use Illuminate\Database\Eloquent\Builder; class FrontController extends Controller { /** * @return Application|Factory|View */ public function medical() { $doctors = Doctor::with('user', 'specializations')->whereHas('user',function (Builder $query){ $query->where('status',User::ACTIVE); })->latest()->take(10)->get(); $sliders = Slider::with('media')->first(); $frontMedicalServices = Service::with('media')->whereStatus(Service::ACTIVE)->latest()->get(); $frontPatientTestimonials = FrontPatientTestimonial::with('media')->latest()->take(6)->get(); $appointmentDoctors = Doctor::with('user')->get()->where('user.status', User::ACTIVE)->pluck('user.full_name', 'id'); $aboutExperience = Setting::where('key', 'about_experience')->first(); return view('fronts.medicals.index', compact('doctors', 'sliders', 'frontMedicalServices', 'frontPatientTestimonials', 'appointmentDoctors', 'aboutExperience')); } /** * @return Application|Factory|View */ public function medicalAboutUs() { $data = []; $data['doctorsCount'] = Doctor::with('user')->get()->where('user.status', true)->count(); $data['patientsCount'] = Patient::get()->count(); $data['servicesCount'] = Service::whereStatus(true)->get()->count(); $data['specializationsCount'] = Specialization::get()->count(); $clinicSchedules = ClinicSchedule::all(); $setting = Setting::where('key','about_us_image')->first(); $frontPatientTestimonials = FrontPatientTestimonial::with('media')->latest()->take(6)->get(); $doctors = Doctor::with('user', 'appointments','specializations')->whereHas('user',function (Builder $query){ $query->where('status',User::ACTIVE); })->withCount('appointments')->orderBy('appointments_count', 'desc')->take(3)->get(); return view('fronts.medical_about_us', compact('doctors', 'data', 'setting', 'clinicSchedules', 'frontPatientTestimonials')); } /** * @return Application|Factory|View */ public function medicalServices() { $data = []; $serviceCategories = ServiceCategory::with('activatedServices')->withCount('services')->get(); $setting = Setting::pluck('value', 'key')->toArray(); $services = Service::with('media')->whereStatus(Service::ACTIVE)->latest()->get(); $data['doctorsCount'] = Doctor::with('user')->get()->where('user.status', true)->count(); $data['patientsCount'] = Patient::get()->count(); $data['servicesCount'] = Service::whereStatus(true)->get()->count(); $data['specializationsCount'] = Specialization::get()->count(); return view('fronts.medical_services', compact('serviceCategories','setting','services','data')); } /** * @return Application|Factory|View */ public function medicalAppointment() { $faqs = Faq::latest()->get(); $appointmentDoctors = Doctor::with('user')->get()->where('user.status', User::ACTIVE)->pluck('user.full_name', 'id'); return view('fronts.medical_appointment', compact('faqs', 'appointmentDoctors')); } /** * @return Application|Factory|View */ public function medicalDoctors() { $doctors = Doctor::with('specializations', 'user')->whereHas('user', function (Builder $query) { $query->where('status', User::ACTIVE); })->latest()->take(9)->get(); return view('fronts.medical_doctors', compact('doctors')); } /** * @return Application|Factory|View */ public function medicalContact() { $clinicSchedules = ClinicSchedule::all(); return view('fronts.medical_contact', compact('clinicSchedules')); } /** * @return Application|Factory|View */ public function termsCondition() { $termConditions = Setting::pluck('value', 'key')->toArray(); return view('fronts.terms_conditions', compact('termConditions')); } /** * @return Application|Factory|View */ public function privacyPolicy() { $privacyPolicy = Setting::pluck('value', 'key')->toArray(); return view('fronts.privacy_policy', compact('privacyPolicy')); } /** * * @return Application|Factory|View */ public function faq() { $faqs = Faq::latest()->get(); return view('fronts.faq', compact('faqs')); } }