@extends('layouts.default') @push('title', get_phrase('Home')) @push('meta')@endpush @push('css') @endpush @section('content') @php $total_students = DB::table('users')->where('role', 'student')->get(); $total_instructors = DB::table('users')->where('role', 'instructor')->get(); $free_courses = DB::table('courses')->where('is_paid', 0)->get(); $premium_courses = DB::table('courses')->where('is_paid', 1)->get(); @endphp
@php $banner_title = get_frontend_settings('banner_title'); $arr = explode(' ', $banner_title); $first_word = $arr[0]; $second_word = $arr[1] ?? ''; array_shift($arr); array_shift($arr); $remaining_text = implode(' ', $arr); @endphp

{{ get_phrase('WELLCOME TO CHEF') }}

{{ $first_word }} {{ $second_word }} {{ $remaining_text }}

{{ get_frontend_settings('banner_sub_title') }}

@php $bannerData = json_decode(get_frontend_settings('banner_image')); $banneractive = get_frontend_settings('home_page'); if ($bannerData !== null && is_object($bannerData) && property_exists($bannerData, $banneractive)) { $banner = json_decode(get_frontend_settings('banner_image'))->$banneractive; } @endphp @if (isset($banner)) @else @endif
{{ get_phrase('Latest Top Skills') }}

{{ get_phrase('Awesome site the top advertising been business.') }}

{{ get_phrase('Industry Experts') }}

{{ get_phrase('Awesome site the top advertising been business.') }}

{{ get_phrase('Learning From Anywhere') }}

{{ get_phrase('Awesome site the top advertising been business.') }}

{{ get_phrase('Top Rated Courses') }}

{{ get_phrase('Top rated course showcases the highest-rated course based on student reviews and performance metrics.') }}

@php $top_courses = DB::table('courses') ->leftJoin('payment_histories', 'courses.id', '=', 'payment_histories.course_id') ->select('courses.id', 'courses.slug', 'courses.thumbnail', 'courses.title', 'courses.average_rating', 'courses.discount_flag', 'courses.is_paid', 'courses.price', 'courses.discounted_price', DB::raw('COUNT(payment_histories.id) as total_sales')) ->groupBy('courses.id', 'courses.slug', 'courses.thumbnail', 'courses.title', 'courses.average_rating', 'courses.discount_flag', 'courses.is_paid', 'courses.price', 'courses.discounted_price') ->where('status', 'active') ->orderByDesc('total_sales') ->take(4) // Number of courses you want to get, e.g., top 4 ->get(); @endphp @foreach ($top_courses as $key => $row) @endforeach

{{ get_phrase('Upcoming Courses') }}

{{ get_phrase('Highlights the latest courses set to launch, giving students a sneak peek at new opportunities for learning and skill development. Stay ahead with our curated selection of upcoming educational offerings!') }}

{{ get_phrase('Featured Courses') }}

{{ get_phrase('Those course highlights a handpicked course with exceptional content or exclusive offerings.') }}

@php $featured_courses = DB::table('courses')->where('status', 'active')->latest('id')->take(4)->get(); @endphp @foreach ($featured_courses->take(4) as $key => $row) @php $ratings = DB::table('reviews') ->where('course_id', $row->id) ->pluck('rating') ->toArray(); $average_rating = count($ratings) > 0 ? array_sum($ratings) / count($ratings) : null; @endphp @endforeach

{{ count($total_students) }}+

{{ get_phrase('Enrolled Learners') }}

{{ count($total_instructors) }}

{{ get_phrase('Online Instructors') }}

{{ count($premium_courses) }}+

{{ get_phrase('Premium courses') }}

{{ count($free_courses) }}+

{{ get_phrase('Cost-free course') }}

{{ get_phrase('Think more clearly') }}

{{ get_phrase('Awesome site. on the top advertising a business online includes assembling Having the most keep.') }}

@php $motivational_speeches = json_decode(get_frontend_settings('motivational_speech'), true); $increment = 1; @endphp @foreach ($motivational_speeches as $key => $motivational_speech)
@php $admininfo = DB::table('users')->where('role', 'admin')->first(); @endphp

{{ $increment++ }}

{{ $motivational_speech['title'] }}

@if ($admininfo->photo) @else @endif
{{ $admininfo->name }}

{{ $motivational_speech['description'] }}

@if ($motivational_speech['image']) @else @endif
@endforeach

{{ get_phrase('Know About Academy LMS Learning Platform') }}

{!! ellipsis(removeScripts(get_frontend_settings('about_us')), 300) !!}
{{ get_phrase('Learn More') }}
@if ($instructor_speech = json_decode(get_homepage_settings('cooking')))
@if (isset($instructor_speech->image)) @else @endif

{{ $instructor_speech->title }}

{!! $instructor_speech->description !!}

@endif

{{ get_phrase('Our Popular Instructor') }}

{{ get_phrase('Highlights our most sought-after educator, recognized for their engaging teaching style and exceptional course content. Discover their expertise and join the many students who have benefited from their classes!') }}

@php $popular_instaructors = DB::table('courses')->select('enrollments.user_id', DB::raw('count(*) as enrol_number'))->join('enrollments', 'courses.id', '=', 'enrollments.course_id')->groupBy('enrollments.user_id')->orderBy('enrollments.user_id', 'DESC')->limit(10)->get(); @endphp @foreach ($popular_instaructors as $key => $instructor) @php $instructorDetails = App\Models\User::where('id', $instructor->user_id)->first(); if (!$instructorDetails) { continue; } @endphp @endforeach

{{ get_phrase('Frequently Asked Questions?') }}

@php $faqs = json_decode(get_frontend_settings('website_faqs'), true); $faqs = count($faqs) > 0 ? $faqs : [['question' => '', 'answer' => '']]; $odd_faqs = array_filter( $faqs, function ($v, $k) { return $k % 2 == 0; }, ARRAY_FILTER_USE_BOTH, ); $even_faqs = array_filter( $faqs, function ($v, $k) { return $k % 2 != 0; }, ARRAY_FILTER_USE_BOTH, ); @endphp
@foreach ($odd_faqs as $key => $faq)

{{ $faq['answer'] }}

@endforeach
@foreach ($even_faqs as $key => $faq)

{{ $faq['answer'] }}

@endforeach
@php use Carbon\Carbon; @endphp @if (get_frontend_settings('blog_visibility_on_the_home_page'))

{{ get_phrase('Follow The Latest News') }}

{{ get_phrase('The latest blog highlights the most recent articles, updates, and insights from our platform.') }}

@endif @endsection