This commit is contained in:
tanch0 2024-06-11 10:24:25 +05:45
parent b3ee8845a8
commit 567d179a36

View File

@ -40,54 +40,17 @@ class WebsiteController extends Controller
]);
}
// public static function index(Request $request, $menu_id = "")
// {
// dd("test");
// $pathInfo = ltrim($request->getPathInfo(), '/');
// $r = explode('/', $pathInfo);
// $menu_alias = end($r);
// $menu_alias1 = str_replace("_", "-", $menu_alias);
// $menuItem = DB::table("menuitems")->where("alias", $menu_alias)->orWhere("alias", $menu_alias1)->get()[0];
// switch ($menuItem->type) {
// case 'tbl_contacts':
// $contact = DB::table("contacts")->where("contact_id", $menuItem->ref)->get()[0];
// return view("client." . env("CLIENT_PATH") . ".inside.contact", compact('contact'));
// // break;
// case 'tbl_countries':
// $countries = DB::table("countries")->where("article_id", $menuItem->ref)->get()[0];
// return view("client." . env("CLIENT_PATH") . ".inside.country_single", compact('country'));
// break;
// case 'tbl_companyarticles':
// $article = DB::table("companyarticles")->where("article_id", $menuItem->ref)->get()[0];
// return view("client." . env("CLIENT_PATH") . ".inside.article", compact('article'));
// //break;
// case 'tbl_recruitmentarticles':
// $recruitmentarticle = DB::table("recruitmentarticles")->where("article_id", $menuItem->ref)->get()[0];
// $article = $recruitmentarticle;
// return view("client." . env("CLIENT_PATH") . ".inside.recruitmentArticle", compact('recruitmentarticle', 'article'));
// case 'tbl_otherarticles':
// $cruiserecruiment = DB::table("otherarticles")->where("article_id", $menuItem->ref)->get()[0];
// $article = $cruiserecruiment;
// return view("client." . env("CLIENT_PATH") . ".inside.cruiserecruitment", compact('cruiserecruiment', 'article'));
// default:
// // echo $menuItem->alias;die;
// if ($menuItem->ref == "/")
// return view("client." . env("CLIENT_PATH") . ".welcome");
// else if ($menuItem->ref == "#")
// return view("client." . env("CLIENT_PATH") . ".welcome");
// else
// return view("client." . env("CLIENT_PATH") . ".inside" . '/' . ltrim($menuItem->ref));
// }
// }
public function home()
{
$data["sliders"] = Sliders::where('status', 1)->latest()->get();
$data["franchises"] = Franchises::latest()->take(4)->get();
$data["testimonials"] = Testimonials::where('status', 1)->latest()->get();
$data['services'] = Services::latest()->where('parent_service',null)->where('status', 1)->take(6)->get();
$data['services'] = Services::latest()->where('parent_service', null)
->orWhere('parent_service', 0)
->where('status', 1)
->inRandomOrder()
->get();
$data['partners'] = Partners::latest()->get();
$data["news"] = News::latest()->take(6)->get();
@ -224,9 +187,6 @@ class WebsiteController extends Controller
} else {
return response()->json(['error' => 'Failed to send email'], 500);
}
}
}
}