/home/techb158/ileadtechnology.com/app/Http/Controllers
Edit: /home/techb158/ileadtechnology.com/app/Http/Controllers/HomeController.php (3056B)
middleware(['auth','verified']);
// }
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index()
{
$category = Categories::orderBy('position','ASC')->get();
$sliders = Slider::orderBy('position', 'ASC')->get();
$facts = SliderFacts::limit(3)->get();
$categories = CategorySlider::first();
$cor = Course::all();
$meetings = Meeting::where('link_by', NULL)->get();
$bigblue = BBL::where('is_ended','!=',1)->where('link_by', NULL)->get();
$testi = Testimonial::all();
$trusted = Trusted::all();
$blogs = Blog::where('status', '1')->get();
$viewed = session()->get('courses.recently_viewed');
if (Schema::hasColumn('bundle_courses', 'is_subscription_enabled'))
{
$bundles = BundleCourse::where('is_subscription_enabled', 0)->get();
$subscriptionBundles = BundleCourse::where('is_subscription_enabled', 1)->get();
}
else{
$bundles = NULL;
$subscriptionBundles = NULL;
}
if(Schema::hasTable('batch')){
$batches = Batch::where('status', '1')->get();
}
else{
$batches = NULL;
}
if(Schema::hasTable('advertisements')){
$advs = Advertisement::where('status','=',1)->get();
}
else{
$advs = NULL;
}
if(isset($viewed))
{
$recent_course_id = array_unique($viewed);
}
else{
$recent_course_id = NULL;
}
$counter = 0;
$recent_course = NULL;
if(Auth::check())
{
if( isset($recent_course_id) )
{
foreach ($recent_course_id as $item) {
$recent_course = Course::where('id', $item)->where('status', '1')->first();
if(isset($recent_course))
{
$counter++;
}
}
}
}
$total_count=$counter-1;
return view('home', compact('category', 'sliders', 'facts', 'categories', 'cor', 'bundles', 'meetings', 'bigblue', 'testi', 'trusted', 'recent_course_id', 'blogs', 'subscriptionBundles', 'batches', 'recent_course', 'total_count', 'advs'));
}
}