master
Mahesh Sharma 2 years ago
parent e269f8c285
commit 67612b1116
  1. 15
      app/Http/Controllers/Admin/HomeController.php
  2. 37
      resources/views/admin/index.blade.php
  3. 8
      resources/views/blogs.blade.php

@ -4,8 +4,9 @@ namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\Contact; use App\Models\Contact;
use App\Models\Referral; use App\Models\Enquiry;
use App\Models\Subscription; use App\Models\Subscription;
use App\Models\VisaService;
use App\Models\Service; use App\Models\Service;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Routing\Route; use Illuminate\Routing\Route;
@ -20,12 +21,14 @@ class HomeController extends Controller
public function indexAdmin() public function indexAdmin()
{ {
if(Auth::check()){ if(Auth::check()){
$service= Service::where('status',true); $visa_service= VisaService::where('status',true);
$education_service= Service::where('status',true);
$enquiry= Enquiry::all();
$contact= Contact::all(); $contact= Contact::all();
$subscription= Contact::all(); $subscription= Subscription::all();
$contacts = Contact::paginate(config('custom.per_page')); $contacts = Contact::paginate(config('custom.per_page'));
// $referrals=Referral::paginate(config('custom.per_page')); // $referrals=Referral::paginate(config('custom.per_page'));
return view('admin.index', compact( 'service', 'contact', 'contacts','subscription')); return view('admin.index', compact( 'visa_service', 'education_service', 'enquiry', 'contacts','contact','subscription'));
} }
return view('admin.login'); return view('admin.login');
} }
@ -77,7 +80,7 @@ class HomeController extends Controller
'password' => 'required|min:8|confirmed', 'password' => 'required|min:8|confirmed',
]); ]);
$user = auth()->user(); $user = auth()->user();
if(Hash::check($request->old_password,$user->password)){ if(Hash::check($request->old_password,$user->password)){
$user = User::findorfail($user->id); $user = User::findorfail($user->id);
@ -88,7 +91,7 @@ class HomeController extends Controller
return redirect()->back()->with('custom_error','Your old password is incorrect! Please try again.'); return redirect()->back()->with('custom_error','Your old password is incorrect! Please try again.');
} }

@ -29,8 +29,8 @@
<!-- small box --> <!-- small box -->
<div class="small-box bg-info"> <div class="small-box bg-info">
<div class="inner"> <div class="inner">
<h3>{{$service-> count()}}</h3> <h3>{{ $visa_service->count() }}</h3>
<p>Service</p> <p>Visa Service</p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="fa-solid fa-headset"></i> <i class="fa-solid fa-headset"></i>
@ -38,49 +38,50 @@
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a> <a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
</div> </div>
</div> </div>
<!-- ./col -->
<div class="col-lg-3 col-6"> <div class="col-lg-3 col-6">
<!-- small box --> <!-- small box -->
<div class="small-box bg-success"> <div class="small-box bg-info">
<div class="inner"> <div class="inner">
<h3>2</h3> <h3>{{ $education_service->count() }}</h3>
<p>Total Number of Referral</p> <p>Education Service</p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="fa-solid fa-user-group"></i> <i class="fa-solid fa-headset"></i>
</div> </div>
<a href="referrals" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a> <a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
</div> </div>
</div> </div>
<!-- ./col --> <!-- ./col -->
<div class="col-lg-3 col-6"> <div class="col-lg-3 col-6">
<!-- small box --> <!-- small box -->
<div class="small-box bg-warning"> <div class="small-box bg-success">
<div class="inner"> <div class="inner">
<h3>{{$contact -> count()}}</h3> <h3>{{ $enquiry->count() }}</h3>
<p>Total Number of Contact</p> <p>Total Number of Enquiries</p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="fa-solid fa-address-book"></i> <i class="fa-solid fa-user-group"></i>
</div> </div>
<a href="contacts" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a> <a href="enquiries" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
</div> </div>
</div> </div>
<!-- ./col --> <!-- ./col -->
<div class="col-lg-3 col-6"> <div class="col-lg-3 col-6">
<!-- small box --> <!-- small box -->
<div class="small-box bg-danger"> <div class="small-box bg-warning">
<div class="inner"> <div class="inner">
<h3>{{$subscription -> count()}}</h3> <h3>{{$contact->count()}}</h3>
<p>Number of Subscription</p> <p>Total Number of Contacts</p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="fa-solid fa-hand-pointer"></i> <i class="fa-solid fa-address-book"></i>
</div> </div>
<a href="subscriptions" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a> <a href="contacts" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
</div> </div>
</div> </div>
<!-- ./col --> <!-- ./col -->
<!-- ./col -->
</div> </div>
<!-- /.row --> <!-- /.row -->
<!-- Main row --> <!-- Main row -->

@ -23,7 +23,7 @@
</section> </section>
<section class="blogs-section"> <section class="blogs-section">
<h2 class="visa-para-title mb-5"> <h2 class="visa-para-title mb-5">
<img src="{{url('frontend/icons/side-bars.svg')}}" class="me-2" alt=""> <img src="{{url('frontend/icons/side-bars.svg')}}" class="me-2" alt="">
Latest Articles Latest Articles
</h2> </h2>
@php @php
@ -40,7 +40,7 @@
{!!(\Illuminate\Support\Str::limit($blog->description, 200, $end='...'))!!}</p> {!!(\Illuminate\Support\Str::limit($blog->description, 200, $end='...'))!!}</p>
<a href="{{url('/blog/'.$blog->slug)}}">Read More <i class="fa-solid fa-arrow-right-long ms-2 fa-sm"></i></a> <a href="{{url('/blog/'.$blog->slug)}}">Read More <i class="fa-solid fa-arrow-right-long ms-2 fa-sm"></i></a>
</div> </div>
</div> </div>
<div class="col-md-7"> <div class="col-md-7">
<div class="related-articles"> <div class="related-articles">
@foreach($blogs->where('blog_type','!=',1) as $blog) @foreach($blogs->where('blog_type','!=',1) as $blog)
@ -52,7 +52,7 @@
<h3 class="dinline mr-3">Study in Australia</h3> <h3 class="dinline mr-3">Study in Australia</h3>
<h6 class="dinline mr-3">{{$blog->publish_date}}</h6> <h6 class="dinline mr-3">{{$blog->publish_date}}</h6>
<h2>{{$blog->title}} </h2> <h2>{{$blog->title}} </h2>
{!!(\Illuminate\Support\Str::limit($blog->description, 200, $end='...'))!!}</p> {!!(\Illuminate\Support\Str::limit($blog->description, 200, $end=''))!!}</p>
<a href="{{url('/blog/'.$blog->slug)}}">Read More <i class="fa-solid fa-arrow-right-long ms-2 fa-xs"></i></a> <a href="{{url('/blog/'.$blog->slug)}}">Read More <i class="fa-solid fa-arrow-right-long ms-2 fa-xs"></i></a>
</div> </div>
</div> </div>
@ -70,4 +70,4 @@
<h5>Get Free Consultation with Experts</h5> <h5>Get Free Consultation with Experts</h5>
</div> </div>
</section> </section>
@endsection @endsection

Loading…
Cancel
Save