HEX
Server: Apache/2.4.46 (Ubuntu)
System: Linux localhost 5.11.0-49-generic #55-Ubuntu SMP Wed Jan 12 17:36:34 UTC 2022 x86_64
User: root (0)
PHP: 7.4.16
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/sarvodayahospital/app/Http/Controllers/HomeController.php
<?php
namespace App\Http\Controllers;

use App\Models\Award;
use App\Models\Blog;
use App\Models\Doctor;
use App\Models\DoctorVideo;
use App\Models\Hospital;
use App\Models\News;
use App\Models\Organ;
use App\Models\PreventiveHealthCheckup;
use App\Models\RareCase;
use App\Models\Speciality;
use App\Models\Technology;
use App\Models\Testimonial;
use Artesaos\SEOTools\Facades\OpenGraph;
use Artesaos\SEOTools\Facades\SEOMeta;
use Illuminate\Support\Facades\Cache;

class HomeController extends Controller
{
    public function index()
    {
        $hospitals = Cache::remember('all-hospitals', 60, function () {
            return Hospital::query()
                ->orderBy('Weight', 'asc')
                ->get();
        });

        $filteredHospitals = $hospitals->whereNotIn('Slug', ['sarvodaya-imaging-centre-with-nrch', 'sarvodaya-imaging-centre-with-ndmc'])->all();

        $specialities = Cache::remember('all_specialities', 60, function () {
            return Speciality::query()
                ->where('IsCentreOfExcellence', true)
                ->orderBy('Weight', 'asc')
                ->get()
                ->take(12);
        });

        $organs = Cache::remember('all_organs', 60, function () {
            return Organ::query()
                ->with('speciality')
                ->get();
        });

        $doctorSpecialityTabs = Speciality::query()
            ->whereHas(
                'doctors',
                function ($q) {
                    $q->orderBy('Weight', 'asc')->limit(4);
                }
            )
            ->where('showAtHome', true)
            ->orderBy('Weight', 'asc')
            ->get()
            ->take(6);

        $doctors = Doctor::query()
            ->orderByRaw('ISNULL(Weight), Weight ASC')
            ->orderBy('Weight', 'asc')
            ->get()
            ->take(4);

        $technologies = Technology::query()
            ->select('id', 'Title', 'Description', 'Slug', 'DisplayName')
            ->orderByWeight()
            ->get()
            ->take(5);

        $awards = Award::query()
            ->orderby('Date', 'DESC')
            ->get()
            ->take(6);

        $rarecases = RareCase::query()
            ->orderBy('created_at', 'DESC')
            ->get()
            ->take(10);

        $news = News::query()
            ->orderBy('PublicationDate', 'DESC')
            ->get()
            ->take(6);

        $phc = PreventiveHealthCheckup::query()
            ->select('id', 'PackageName', 'Slug')
            ->get()
            ->take(6);

        $testimonials = Testimonial::query()
            ->orderBy('Date', 'DESC')
            ->get()
            ->take(4);

        $doctorvideos = DoctorVideo::query()
            ->orderBy('Date', 'DESC')
            ->get()
            ->take(4);

        $blogs = Blog::query()
            ->orderBy('BlogCreatedDate', 'DESC')
            ->get()
            ->take(10);

        SEOMeta::setTitle('Best Hospital in Faridabad Delhi NCR, India | Sarvodaya Hospital', false)
            ->setDescription('Sarvodaya Hospital is one of the Top and Best multi-specialty hospital in Faridabad Delhi NCR, India with provide the world class healthcare services in India.')
            ->setKeywords('Best Hospitals In India, Top Hospitals In India, Hospital In Faridabad, Best Hospital In Delhi, Hospitals In India, Best Hospitals In Faridabad, Top Hospitals In Greater Noida');

        OpenGraph::setTitle('Best Hospital in Faridabad Delhi NCR, India | Sarvodaya Hospital')
            ->setDescription('Sarvodaya Hospital is one of the Top and Best multi-specialty hospital in Faridabad Delhi NCR, India with provide the world class healthcare services in India.');

        return view(
            'pages.home',
            compact(
                'hospitals',
                'filteredHospitals',
                'specialities',
                'doctorSpecialityTabs',
                'doctors',
                'technologies',
                'awards',
                'rarecases',
                'news',
                'phc',
                'testimonials',
                'doctorvideos',
                'blogs',
                'organs'
            )
        );
    }
}