@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("Lorem Ipsum has been the industry's standard dummy text ever since the unknown printer took a galley of type and scrambled") }}

@php $top_courses = DB::table('courses')->join('reviews', 'courses.id', '=', 'reviews.course_id')->select('courses.*', DB::raw('COUNT(reviews.id) as review_count'), DB::raw('AVG(reviews.rating) as average_rating'))->groupBy('courses.id')->orderByDesc('review_count')->take(4)->get(); @endphp @foreach ($top_courses as $key => $row) @endforeach

{{ get_phrase('Upcoming Courses') }}

{{ get_phrase("Lorem Ipsum has been the industry's standard dummy text ever since the unknown printer took a galley of type and scrambled") }}

{{ get_phrase('Featured Courses') }}

{{ get_phrase("Lorem Ipsum has been the industry's standard dummy text ever since the unknown printer took a galley of type and scrambled") }}

@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
@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("Lorem Ipsum has been the industry's standard dummy text ever since the unknown printer took a galley of type and scrambled") }}

@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?') }}

{{ get_phrase("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate ad litora torquent per conubi himenaeos Awesome site Lorem Ipsum has been the industry's standard dummy text ever since.") }}

@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("Lorem Ipsum has been the industry's standard dummy text ever since the unknown printer took a galley of type and scrambled") }}

@endif @endsection