Compare commits

..

4 Commits

Author SHA1 Message Date
Mahesh Sharma 564529895f implementing-task-scheduler 2 years ago
Mahesh Sharma cce8fd095a appointment 2 years ago
tribikram f860a36947 [edit] contents for privacy and about us 2 years ago
Mahesh Sharma 67612b1116 blog 2 years ago
  1. 36
      app/Console/Commands/CheckQueue.php
  2. 33
      app/Console/Commands/ProcessQueue.php
  3. 2
      app/Console/Kernel.php
  4. 20
      app/Http/Controllers/Admin/AppointmentController.php
  5. 11
      app/Http/Controllers/Admin/HomeController.php
  6. 37
      app/Http/Controllers/AppointmentController.php
  7. 2
      app/Http/Controllers/BlogController.php
  8. 1
      app/Http/Controllers/EnquiryController.php
  9. 1
      app/Http/Controllers/HomeController.php
  10. 37
      resources/views/admin/index.blade.php
  11. 1
      resources/views/appointment_confirmed.blade.php
  12. 25
      resources/views/appointment_confirmed_for_admin.blade.php
  13. 2
      resources/views/blogs.blade.php
  14. 2
      resources/views/layout/app.blade.php

@ -0,0 +1,36 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Queue;
class CheckQueue extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'queue:check';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Check if there is a job in the queue';
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$count = Queue::size(); // Get the number of jobs in the queue
if ($count > 0) {
$this->call('queue:process'); // Call the ProcessQueue command if there is a job in the queue
}
}
}

@ -0,0 +1,33 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Queue;
class ProcessQueue extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'queue:process';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Process the tasks in the queue';
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
Queue::daemon(); // Process the tasks in the queue
}
}

@ -15,7 +15,7 @@ class Kernel extends ConsoleKernel
*/ */
protected function schedule(Schedule $schedule) protected function schedule(Schedule $schedule)
{ {
// $schedule->command('inspire')->hourly(); $schedule->command('queue:check')->everyMinute();
} }
/** /**

@ -73,11 +73,10 @@ class AppointmentController extends Controller
'date' => 'required|date', 'date' => 'required|date',
'start_time' => 'required|date_format:H:i', 'start_time' => 'required|date_format:H:i',
'end_time' => 'required|date_format:H:i', 'end_time' => 'required|date_format:H:i',
// 'location' => 'required|max:255',
// 'description' => 'required',
]); ]);
$start_time = Carbon::createFromFormat('H:i', $request->get('start_time'))->format('H:i A'); $start_time = Carbon::createFromFormat('H:i', $request->get('start_time'))->format('H:i A');
$end_time = Carbon::createFromFormat('H:i', $request->get('end_time'))->format('H:i A'); $end_time = Carbon::createFromFormat('H:i', $request->get('end_time'))->format('H:i A');
$appointment = new Appointment([ $appointment = new Appointment([
'date' => $request->get('date'), 'date' => $request->get('date'),
'start_time' => $start_time, 'start_time' => $start_time,
@ -88,8 +87,13 @@ class AppointmentController extends Controller
]); ]);
$appointment->save(); $appointment->save();
if($request->get('service_type') == "1"){
$service = 'education';
}else{
$service = 'visa';
}
return redirect($this->redirect)->with('success', 'Appointment has been added'); return redirect($this->redirect.'/'.$service)->with('success', 'Appointment has been added');
} }
public function edit($id) public function edit($id)
@ -107,12 +111,11 @@ class AppointmentController extends Controller
public function update(Request $request, $id) public function update(Request $request, $id)
{ {
$request->validate([ $request->validate([
'date' => 'required|date', 'date' => 'required|date',
'start_time' => 'required|date_format:H:i', 'start_time' => 'required|date_format:H:i',
'end_time' => 'required|date_format:H:i', 'end_time' => 'required|date_format:H:i',
// 'location' => 'required|max:255',
// 'description' => 'required',
]); ]);
$start_time = Carbon::createFromFormat('H:i', $request->get('start_time'))->format('H:i A'); $start_time = Carbon::createFromFormat('H:i', $request->get('start_time'))->format('H:i A');
$end_time = Carbon::createFromFormat('H:i', $request->get('end_time'))->format('H:i A'); $end_time = Carbon::createFromFormat('H:i', $request->get('end_time'))->format('H:i A');
@ -126,8 +129,13 @@ class AppointmentController extends Controller
$appointment->service_type = $request->get('service_type'); $appointment->service_type = $request->get('service_type');
$appointment->status = $request->get('status'); $appointment->status = $request->get('status');
$appointment->save(); $appointment->save();
if($request->get('service_type') == "1"){
$service = 'education';
}else{
$service = 'visa';
}
return redirect($this->redirect)->with('success', 'Appointment has been updated'); return redirect($this->redirect.'/'.$service)->with('success', 'Appointment has been updated');
} }
public function show($id) public function show($id)

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

@ -75,7 +75,7 @@ class AppointmentController extends Controller
$formated_date = $date->format('M d, Y'); $formated_date = $date->format('M d, Y');
$appointment->is_booked = true; $appointment->is_booked = true;
$appointment->save(); $appointment->save();
$subject = 'Appointment Confirmed'; $subject = 'Appointment Booked Successfully.';
dispatch(function() use ($name,$email,$phone,$subject,$formated_date,$appointment) { dispatch(function() use ($name,$email,$phone,$subject,$formated_date,$appointment) {
\Mail::send('appointment_confirmed', array( \Mail::send('appointment_confirmed', array(
@ -98,11 +98,44 @@ class AppointmentController extends Controller
), function($message) use ($subject,$email,$name){ ), function($message) use ($subject,$email,$name){
// $subject=($service!= '') ? 'Enquiry for '.$service : 'Contact/Feedback'; // $subject=($service!= '') ? 'Enquiry for '.$service : 'Contact/Feedback';
$message->subject($subject); $message->subject($subject);
// $message->from('admin@eteducation.com.au', 'Admin');
$message->to($email, $name)->subject($subject); $message->to($email, $name)->subject($subject);
// $message->cc('extratechweb@gmail.com', 'Extratech')->subject($subject); // $message->cc('extratechweb@gmail.com', 'Extratech')->subject($subject);
// $message->cc('suman@extratechs.com.au', 'Extratech')->subject($subject); // $message->cc('admin@eteducation.com.au', 'Extratech')->subject($subject);
}); });
});
dispatch(function() use ($name,$email,$phone,$subject,$formated_date,$appointment) {
\Mail::send('appointment_confirmed_for_admin', array(
'full_name' =>$name,
'email' =>$email,
'date' => $formated_date,
'start_time' => $appointment['start_time'],
'end_time' => $appointment['end_time'],
'phone' =>$phone,
'subject' =>$subject
), function($message) use ($subject){
// $subject=($service!= '') ? 'Enquiry for '.$service : 'Contact/Feedback';
$message->subject($subject);
// $message->to($email, $name)->subject($subject);
$message->to('mahesh@extratechs.com.au', 'Extratech')->subject($subject);
// $message->cc('admin@eteducation.com.au', 'Extratech')->subject($subject);
});
}); });
} }

@ -9,7 +9,7 @@ use App\Models\Page;
class BlogController extends Controller class BlogController extends Controller
{ {
public function index(){ public function index(){
$page = Page::where(['title' => 'Blog','status' => 1])->first(); $page = Page::where(['title' => 'Blogs','status' => 1])->first();
$blogs = NewsAndUpdate::where('status',1)->get(); $blogs = NewsAndUpdate::where('status',1)->get();
return view('blogs',compact('blogs','page')); return view('blogs',compact('blogs','page'));
} }

@ -28,7 +28,6 @@ class EnquiryController extends Controller
} }
$marital_status = $request->get('marital_status'); $marital_status = $request->get('marital_status');
if ($marital_status == 'Widow' || $marital_status == 'Single') { if ($marital_status == 'Widow' || $marital_status == 'Single') {
$request['married_date'] = null; $request['married_date'] = null;
$request['spouse_academics'] = null; $request['spouse_academics'] = null;
$request['spouse_work_experience'] = null; $request['spouse_work_experience'] = null;

@ -20,6 +20,7 @@ class HomeController extends Controller
Artisan::call('queue:listen'); Artisan::call('queue:listen');
} }
public function index(){ public function index(){
$sliders = Slider::where('status',1)->get(); $sliders = Slider::where('status',1)->get();
$testimonials = Testimonial::where('status',1)->get(); $testimonials = Testimonial::where('status',1)->get();
$blogs = NewsAndUpdate::where('status',1)->get(); $blogs = NewsAndUpdate::where('status',1)->get();

@ -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 -->

@ -19,6 +19,7 @@
<b>Appointment End Time:</b>{{$end_time}}<br /><br /> <b>Appointment End Time:</b>{{$end_time}}<br /><br />
<b>Your Full Name:</b> {{ $full_name }}<br /><br /> <b>Your Full Name:</b> {{ $full_name }}<br /><br />
<b>Phone:</b> {{$phone}}<br /><br /> <b>Phone:</b> {{$phone}}<br /><br />
</div> </div>
</div> </div>

@ -0,0 +1,25 @@
<style>
.main-column{
display:flex;
width:100%;
}
.column-one{
width:50%;
}
</style>
<h1>Appointment Confirmed</h1>
<br />
<div class="main-column" style = "display:block; width:100%;">
<div class="column-one" style = "display:block; width:100%;">
<h3>Appointment Details</h3>
<b>Appointment Date: </b>{{$date}}<br /><br />
<b>Appointment Start Time: </b>{{$start_time}}<br /><br />
<b>Appointment End Time: </b>{{$end_time}}<br /><br />
<b>Appointee Full Name: </b> {{ $full_name }}<br /><br />
<b>Phone:</b> {{$phone}}<br /><br />
<b>Email:</b> {{$email}}<br /><br />
</div>
</div>

@ -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>

@ -115,7 +115,7 @@
</ul> </ul>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="{{url('/blogs')}}">BLOG</a> <a class="nav-link" href="{{url('/blogs')}}">BLOGS</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="{{url('contact')}}">CONTACT</a> <a class="nav-link" href="{{url('contact')}}">CONTACT</a>

Loading…
Cancel
Save