Viewing: Menu.php
<?php namespace App\Models; use Illuminate\Support\Facades\View; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Request; use Illuminate\Database\Eloquent\Factories\HasFactory; class Menu extends Model { use HasFactory; protected $guarded = []; protected $table = 'menus'; public function aboutus($request, $slug) { $aboutus = CmsPage::where('id','1')->first(); $whyChooseUs = CmsPage::where('id','2')->first(); $cmscompany = CmsPage::where('id','7')->first(); $cmsmessage = CmsPage::where('id','8')->first(); $cmsgoal = CmsPage::where('id','9')->first(); $teams = Team::orderBy('id','asc')->get(); $cmsFooterAboutus = CmsPage::where('id','10')->first(); $mission = CmsPage::where('id','11')->first(); $vision = CmsPage::where('id','12')->first(); $visionTitle = CmsPage::where('id','12')->first(); $missionTitle = CmsPage::where('id','11')->first(); $aboutusTitle = CmsPage::where('id','1')->first(); $whyChooseUsTitle = CmsPage::where('id','2')->first(); $about = Configuration::orderBy('id','ASC')->first(); View::share(['data' => $about->about_meta]); return view('frontend.about-us',compact('mission','vision','visionTitle','missionTitle','aboutusTitle','whyChooseUsTitle','aboutus','teams','whyChooseUs','cmscompany','cmsgoal','cmsmessage','about')); } public function projects($request, $slug) { // dd($slug); $projects = Project::where('status', '1')->orderBy('id','desc')->get(); $project_tag = Configuration::orderBy('id','ASC')->first(); View::share(['data' => $project_tag->project_meta]); return view('frontend.projects',compact('projects','project_tag')); } public function index($request, $slug) { // $currentDay = date('Y-m-d'); // $newsEvents = NewsEvent::select('id', 'name', 'image_url', 'description', 'start_date', 'end_date', 'start_time', 'end_time', 'city_id', 'address') // ->where('start_date', '>=', $currentDay)->get(); // return view('Frontend.newsEvents.listing', ['newsEvents' => $newsEvents]); $blogs = Blog::orderBy('id','desc')->where('is_active', '1')->paginate(18); $blog_tag = Configuration::orderBy('id','ASC')->first(); View::share(['data' => $blog_tag->blog_meta]); return view('frontend.bloglist',compact('blogs','blog_tag')); } public function services($request, $slug) { $services = Service::orderBy('id','asc')->get(); $service = Configuration::orderBy('id','ASC')->first(); View::share(['data' => $service->service_meta]); return view('frontend.services',compact('services','service','slug')); } public function maps($request, $slug) { $maps = Map::orderBy('id','asc')->where('status', '1')->get(); $map_tag = Configuration::orderBy('id','ASC')->first(); View::share(['data' => $map_tag->map_meta]); return view('frontend.maps',compact('maps','map_tag')); } public function newsindex($request, $slug) { // $currentDay = date('Y-m-d'); // $newsEvents = NewsEvent::select('id', 'name', 'image_url', 'description', 'start_date', 'end_date', 'start_time', 'end_time', 'city_id', 'address') // ->where('start_date', '>=', $currentDay)->get(); // return view('Frontend.newsEvents.listing', ['newsEvents' => $newsEvents]); $events = NewsEvent::orderBy('id','desc')->paginate(18); $news_tag = Configuration::orderBy('id','ASC')->first(); View::share(['data' => $news_tag->news_meta]); return view('frontend.news-events',compact('events','news_tag')); } public function gallery($request, $slug) { $galleries = Gallery::orderBy('id','asc')->get(); $gallery_tag = Configuration::orderBy('id','ASC')->first(); View::share(['data' => $gallery_tag->gallery_meta]); return view('frontend.gallery',compact('galleries','gallery_tag')); } public function downloads($request, $slug) { $downloads = Download::orderBy('id','asc')->where('status', '1')->get(); $download_tag = Configuration::orderBy('id','ASC')->first(); View::share(['data' => $download_tag->download_meta]); return view('frontend.downloads',compact('downloads','download_tag')); } public function ourTeam($team_slug) { $teams = Team::all(); $cmsTeams = CmsPage::where('id','3')->first(); $cmsmessage = CmsPage::where('id','8')->first(); $cmsmessageTitle = CmsPage::where('id','8')->first(); $cmsOperation = CmsPage::where('id','7')->first(); $cmsOperationTitle = CmsPage::where('id','7')->first(); $cmsMarketing = CmsPage::where('id','9')->first(); $cmsMarketingTitle = CmsPage::where('id','9')->first(); $cmsSale = CmsPage::where('id','13')->first(); $cmsSaleTitle = CmsPage::where('id','13')->first(); $team_tag = Configuration::orderBy('id','ASC')->first(); View::share(['data' => $team_tag->team_meta]); return view('frontend.our-team',compact('teams','cmsTeams', 'team_tag','cmsmessage','cmsmessageTitle','cmsOperation','cmsOperationTitle','cmsMarketing','cmsMarketingTitle','cmsSaleTitle','cmsSale')); } // public function properties($slug, $type = null ) // { // // dd($slug); // $properties = []; // $locations = Location::select('id', 'name')->where('city_id', '1')->where('is_active', '1')->orderBy('name', 'ASC')->get(); // $cities = City::with('properties')->whereHas('properties')->where('is_active','1')->orderBy('name', 'ASC')->get(); // $propertyTypes = PropertyCategory::select('id', 'title')->where('is_active', '1')->orderBy('title', 'ASC')->get(); // $property_tag = Configuration::orderBy('id','ASC')->first(); // View::share(['data' => $property_tag->property_meta]); // if ($type != null && in_array($type, ['rent', 'sale'])) { // $properties = Property::where('type', $type)->where('status', '1')->orderBy('id', 'DESC')->paginate(21); // $title = $type == 'sale' ? "BlackStone Sale Properties" : "BlackStone Rent Properties"; // } else { // $properties = Property::where('status', '1')->orderBy('id', 'DESC')->paginate(21); // $title = "BlackStone Properties"; // } // return view('frontend.properties', compact('properties', 'title' ,'locations','cities' ,'propertyTypes','property_tag','slug')); // } public function trending($slug, $type = null ) { $properties = []; $locations = Location::select('id', 'name')->where('city_id', '1')->where('is_active', '1')->orderBy('name', 'ASC')->get(); $cities = City::with('properties')->whereHas('properties')->where('is_active','1')->orderBy('name', 'ASC')->get(); $propertyTypes = PropertyCategory::select('id', 'title')->where('is_active', '1')->orderBy('title', 'ASC')->get(); $property_tag = Configuration::orderBy('id','ASC')->first(); View::share(['data' => $property_tag->property_meta]); $properties = Property::where('status', '1')->where('trending', 1)->orderBy('id', 'DESC')->paginate(21); $title = $type == 'sale' ? "BlackStone Sale Properties" : "BlackStone Trending Properties"; return view('frontend.properties', compact('properties', 'title' ,'locations','cities' ,'propertyTypes','property_tag','slug')); } public function privacy($privacy_slug) { $cmsPrivacy = CmsPage::where('id','5')->first(); $cmsPrivacyTitle = CmsPage::where('id','5')->first(); $privacy_tag = Configuration::orderBy('id','ASC')->first(); View::share(['data' => $privacy_tag->privacy_meta]); return view('frontend.privacy',compact('cmsPrivacy','privacy_tag','cmsPrivacyTitle')); } public function terms($term_slug) { $cmsTerms = CmsPage::where('id','6')->first(); $cmsTermsTitle = CmsPage::where('id','6')->first(); $term_tag = Configuration::orderBy('id','ASC')->first(); View::share(['data' => $term_tag->term_meta]); return view('frontend.terms',compact('cmsTerms','term_tag','cmsTermsTitle')); } }
Return