Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
tribikram | 2a79f071e8 | 2 years ago |
tribikram | 6f43bcfc46 | 2 years ago |
tribikram | f6cf403aef | 2 years ago |
tribikram | d4ec27af38 | 2 years ago |
tribikram | 74acfec022 | 2 years ago |
tribikram | c7d2f3e8d4 | 2 years ago |
@ -1,36 +0,0 @@ |
|||||||
<?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 |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -1,33 +0,0 @@ |
|||||||
<?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 |
|
||||||
} |
|
||||||
} |
|
@ -1,15 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace App\Http\Controllers; |
|
||||||
|
|
||||||
use Illuminate\Http\Request; |
|
||||||
use App\Models\AboutUs; |
|
||||||
|
|
||||||
class AboutUsController extends Controller |
|
||||||
{ |
|
||||||
public function index() |
|
||||||
{ |
|
||||||
$about = AboutUs::where('status', true)->first(); |
|
||||||
return view('about', compact('about')); |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,278 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin; |
||||||
|
|
||||||
|
use App\Http\Controllers\Controller; |
||||||
|
use App\Models\Accomodation; |
||||||
|
use App\Models\BlogPoint; |
||||||
|
use App\Models\NewsAndUpdatePoint; |
||||||
|
use App\Models\Setting; |
||||||
|
use App\Models\User; |
||||||
|
use App\Models\AccomodationFeature; |
||||||
|
use App\Models\AccomodationInformation; |
||||||
|
use App\Models\AccomodationSliderTitle; |
||||||
|
use App\Models\AccomodationImage; |
||||||
|
use Illuminate\Http\Request; |
||||||
|
use Illuminate\Support\Facades\Auth; |
||||||
|
use Illuminate\Support\Facades\Session; |
||||||
|
// use function GuzzleHttp\Promise\all; |
||||||
|
|
||||||
|
class AccomodationController extends Controller |
||||||
|
{ |
||||||
|
protected $view = 'admin.accomodation.'; |
||||||
|
protected $redirect = 'admin/accomodations'; |
||||||
|
|
||||||
|
public function index() |
||||||
|
{ |
||||||
|
$settings = Accomodation::orderBy('id','DESC'); |
||||||
|
|
||||||
|
if(\request('name')){ |
||||||
|
$key = \request('name'); |
||||||
|
$settings = $settings->where('title','like','%'.$key.'%'); |
||||||
|
} |
||||||
|
if(\request('status')){ |
||||||
|
$key = \request('status'); |
||||||
|
$settings = $settings->where('status',$key); |
||||||
|
} |
||||||
|
$settings = $settings->paginate(config('custom.per_page')); |
||||||
|
return view($this->view.'index',compact('settings')); |
||||||
|
} |
||||||
|
|
||||||
|
public function create() |
||||||
|
{ |
||||||
|
return view($this->view . 'create'); |
||||||
|
} |
||||||
|
|
||||||
|
public function store(Request $request) |
||||||
|
{ |
||||||
|
|
||||||
|
$this->validate(\request(), [ |
||||||
|
'title' => 'required', |
||||||
|
'phone' => 'required', |
||||||
|
'address' => 'required', |
||||||
|
'status' => 'required', |
||||||
|
'images' => 'required', |
||||||
|
'slider_image' => 'required|file|mimes:jpeg,png,jpg' |
||||||
|
]); |
||||||
|
|
||||||
|
if($request->has('slider_image')){ |
||||||
|
|
||||||
|
$extension = \request()->file('slider_image')->getClientOriginalExtension(); |
||||||
|
$image_folder_type = array_search('accomodation',config('custom.image_folders')); //for image saved in folder |
||||||
|
$count = rand(100,999); |
||||||
|
$out_put_path = User::save_image(\request()->file('slider_image'),$extension,$count,$image_folder_type); |
||||||
|
$image_path1 = $out_put_path[0]; |
||||||
|
} |
||||||
|
|
||||||
|
$requestData = $request->all(); |
||||||
|
if(isset($image_path1)){ |
||||||
|
$requestData['slider_image'] = $image_path1; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
// $requestData['slug'] = Setting::create_slug($requestData['keyword']); |
||||||
|
$accomodation = Accomodation::create($requestData); |
||||||
|
|
||||||
|
if($request->hasFile('images')){ |
||||||
|
foreach($request->file('images') as $imagefile) { |
||||||
|
$extension = $imagefile->getClientOriginalExtension(); |
||||||
|
$image_folder_type = array_search('accomodation',config('custom.image_folders')); //for image saved in folder |
||||||
|
$count = rand(100,999); |
||||||
|
$out_put_path = User::save_image($imagefile,$extension,$count,$image_folder_type); |
||||||
|
$image_path1 = $out_put_path[0]; |
||||||
|
$accomodation_image = new AccomodationImage(); |
||||||
|
$accomodation_image->accomodation_id = $accomodation->id; |
||||||
|
$accomodation_image->image = $image_path1; |
||||||
|
$accomodation_image->save(); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
if(\request('feature_name')){ |
||||||
|
foreach (\request('feature_name') as $index => $value){ |
||||||
|
$setting_point = new AccomodationFeature(); |
||||||
|
$setting_point->accomodation_id = $accomodation->id; |
||||||
|
$setting_point->feature_name = $value; |
||||||
|
$setting_point->save(); |
||||||
|
} |
||||||
|
} |
||||||
|
if(\request('information_name')){ |
||||||
|
foreach (\request('information_name') as $index => $value){ |
||||||
|
$setting_point = new AccomodationInformation(); |
||||||
|
$setting_point->accomodation_id = $accomodation->id; |
||||||
|
$setting_point->information_name = $value; |
||||||
|
$setting_point->save(); |
||||||
|
} |
||||||
|
} |
||||||
|
if(\request('title_name')){ |
||||||
|
foreach (\request('title_name') as $index => $value){ |
||||||
|
$setting_point = new AccomodationSliderTitle(); |
||||||
|
$setting_point->accomodation_id = $accomodation->id; |
||||||
|
$setting_point->title_name = $value; |
||||||
|
$setting_point->save(); |
||||||
|
} |
||||||
|
} |
||||||
|
Session::flash('success','Accomodation successfully created'); |
||||||
|
return redirect($this->redirect); |
||||||
|
} |
||||||
|
|
||||||
|
public function show($id) |
||||||
|
{ |
||||||
|
$setting =Accomodation::findorfail($id); |
||||||
|
return view($this->view.'show',compact('setting')); |
||||||
|
} |
||||||
|
|
||||||
|
public function edit($id){ |
||||||
|
$setting =Accomodation::findorfail($id); |
||||||
|
return view($this->view.'edit',compact('setting')); |
||||||
|
} |
||||||
|
|
||||||
|
public function update(Request $request, $id){ |
||||||
|
|
||||||
|
// dd(\request()->all()); |
||||||
|
$setting =Accomodation::findorfail($id); |
||||||
|
$this->validate(\request(), [ |
||||||
|
'title' => 'required', |
||||||
|
'phone' => 'required', |
||||||
|
'address' => 'required', |
||||||
|
'status' => 'required' |
||||||
|
// 'images' => 'required', |
||||||
|
// 'slider_image' => 'required|file|mimes:jpeg,png,jpg' |
||||||
|
]); |
||||||
|
|
||||||
|
if(\request('slider_image')){ |
||||||
|
$this->validate(\request(),[ |
||||||
|
'image' => 'file|mimes:jpeg,png,jpg' |
||||||
|
]); |
||||||
|
if($request->hasFile('slider_image')){ |
||||||
|
$extension = $request->file('slider_image')->getClientOriginalExtension(); |
||||||
|
$image_folder_type = array_search('accomodation',config('custom.image_folders')); //for image saved in folder |
||||||
|
$count = rand(100,999); |
||||||
|
$out_put_path = User::save_image($request->file('slider_image'),$extension,$count,$image_folder_type); |
||||||
|
$image_path1 = $out_put_path[0]; |
||||||
|
if (is_file(public_path().'/'.$setting->slider_image) && file_exists(public_path().'/'.$setting->slider_image)){ |
||||||
|
unlink(public_path().'/'.$setting->slider_image); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
$requestData = $request->all(); |
||||||
|
// $requestData['slug'] = Setting::create_slug($requestData['keyword']); |
||||||
|
if(isset($image_path1)){ |
||||||
|
$requestData['slider_image'] = $image_path1; |
||||||
|
} |
||||||
|
$setting->fill($requestData); |
||||||
|
if($setting->save()){ |
||||||
|
|
||||||
|
if($request->hasFile('images')){ |
||||||
|
|
||||||
|
$accommodation_image = $setting->accommodation_images(); |
||||||
|
$accommodation_image->delete(); |
||||||
|
foreach($request->file('images') as $imagefile) { |
||||||
|
$extension = $imagefile->getClientOriginalExtension(); |
||||||
|
$image_folder_type = array_search('accomodation',config('custom.image_folders')); //for image saved in folder |
||||||
|
$count = rand(100,999); |
||||||
|
$out_put_path = User::save_image($imagefile,$extension,$count,$image_folder_type); |
||||||
|
$image_path1 = $out_put_path[0]; |
||||||
|
// if (is_file(public_path().'/'.$setting->slider_image) && file_exists(public_path().'/'.$setting->slider_image)){ |
||||||
|
// unlink(public_path().'/'.$setting->slider_image); |
||||||
|
// } |
||||||
|
$accomodation_image = new AccomodationImage(); |
||||||
|
$accomodation_image->accomodation_id = $id; |
||||||
|
$accomodation_image->image = $image_path1; |
||||||
|
$accomodation_image->save(); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
if(\request('feature_name') ){ |
||||||
|
$accommodation_feature = $setting->accommodation_features(); |
||||||
|
$accommodation_feature->delete(); |
||||||
|
foreach (\request('feature_name') as $index => $value){ |
||||||
|
$setting_point = new AccomodationFeature(); |
||||||
|
$setting_point->accomodation_id = $id; |
||||||
|
$setting_point->feature_name = $value; |
||||||
|
$setting_point->save(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if(\request('information_name') ){ |
||||||
|
$accommodation_information = $setting->accommodation_informations(); |
||||||
|
$accommodation_information->delete(); |
||||||
|
foreach (\request('information_name') as $index => $value){ |
||||||
|
$setting_point = new AccomodationInformation(); |
||||||
|
$setting_point->accomodation_id = $id; |
||||||
|
$setting_point->information_name = $value; |
||||||
|
$setting_point->save(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if(\request('title_name') ){ |
||||||
|
$accommodation_title = $setting->accommodation_slider_titles(); |
||||||
|
$accommodation_title->delete(); |
||||||
|
foreach (\request('title_name') as $index => $value){ |
||||||
|
$setting_point = new AccomodationSlidertitle(); |
||||||
|
$setting_point->accomodation_id = $id; |
||||||
|
$setting_point->title_name = $value; |
||||||
|
$setting_point->save(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
Session::flash('success','Accomodation succesffuly edited.'); |
||||||
|
return redirect($this->redirect); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
public function delete($id){ |
||||||
|
$setting=Accomodation::findorfail($id); |
||||||
|
// if($setting->accommodation_features->count() > 0){ |
||||||
|
// $setting->accommodation_features()->delete(); |
||||||
|
// } |
||||||
|
// if($setting->accommodation_informations->count() > 0){ |
||||||
|
// $setting->accommodation_informations()->delete(); |
||||||
|
// } |
||||||
|
// if($setting->accommodation_slider_titles->count() > 0){ |
||||||
|
// $setting->accommodation_informations()->delete(); |
||||||
|
// } |
||||||
|
if($setting->delete()){ |
||||||
|
if (is_file(public_path().'/'.$setting->slider_image) && file_exists(public_path().'/'.$setting->slider_image)){ |
||||||
|
unlink(public_path().'/'.$setting->slider_image); |
||||||
|
} |
||||||
|
} |
||||||
|
Session::flash('success','Accomodation successfully is deleted !'); |
||||||
|
return redirect($this->redirect); |
||||||
|
} |
||||||
|
|
||||||
|
public function points_remove($id) |
||||||
|
{ |
||||||
|
if(Auth::user()){ |
||||||
|
$setting = AccomodationFeature::findorfail($id); |
||||||
|
$setting->delete(); |
||||||
|
return response()->json(['point_id' => $id]); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
public function information_points_remove($id) |
||||||
|
{ |
||||||
|
if(Auth::user()){ |
||||||
|
$setting = AccomodationInformation::findorfail($id); |
||||||
|
$setting->delete(); |
||||||
|
return response()->json(['point_id' => $id]); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
public function slider_points_remove($id) |
||||||
|
{ |
||||||
|
if(Auth::user()){ |
||||||
|
$setting = AccomodationSliderTitle::findorfail($id); |
||||||
|
$setting->delete(); |
||||||
|
return response()->json(['point_id' => $id]); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -1,155 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace App\Http\Controllers\Admin; |
|
||||||
|
|
||||||
use App\Http\Controllers\Controller; |
|
||||||
|
|
||||||
|
|
||||||
use App\Models\Appointment; |
|
||||||
use Illuminate\Http\Request; |
|
||||||
use Carbon\Carbon; |
|
||||||
|
|
||||||
class AppointmentController extends Controller |
|
||||||
{ |
|
||||||
protected $view = 'admin.appointment.'; |
|
||||||
protected $redirect = 'admin/appointments'; |
|
||||||
// protected $service; |
|
||||||
|
|
||||||
public function education_appointments() |
|
||||||
{ |
|
||||||
$appointments = Appointment::where('service_type', '1')->orderBy('id', 'DESC'); |
|
||||||
if (\request('date')) { |
|
||||||
$date = \request('date'); |
|
||||||
$appointments = $appointments->whereDate('date', $date); |
|
||||||
} |
|
||||||
if (\request('status')) { |
|
||||||
$status = \request('status'); |
|
||||||
$appointments = $appointments->where('status', $status); |
|
||||||
} |
|
||||||
if (\request('is_booked')) { |
|
||||||
$is_booked = (\request('is_booked')) == '1' ? true : false; |
|
||||||
$appointments = $appointments->where('is_booked', $is_booked); |
|
||||||
} |
|
||||||
$appointments = $appointments->paginate(20); |
|
||||||
$service = 'Education'; |
|
||||||
$is_booked = $is_booked ?? null; |
|
||||||
$date = $date ?? null; |
|
||||||
$status = $status ?? null; |
|
||||||
return view($this->view . 'index', compact('appointments', 'service', 'is_booked', 'date', 'status')); |
|
||||||
} |
|
||||||
|
|
||||||
public function visa_appointments() |
|
||||||
{ |
|
||||||
$appointments = Appointment::where('service_type', '2')->orderBy('id', 'DESC'); |
|
||||||
if (\request('date')) { |
|
||||||
$date = \request('date'); |
|
||||||
$appointments = $appointments->whereDate('date', $date); |
|
||||||
} |
|
||||||
if (\request('status')) { |
|
||||||
$status = \request('status'); |
|
||||||
$appointments = $appointments->where('status', $status); |
|
||||||
} |
|
||||||
if (\request('is_booked')) { |
|
||||||
|
|
||||||
$is_booked = (\request('is_booked')) == '1' ? true : false; |
|
||||||
$appointments = $appointments->where('is_booked', $is_booked); |
|
||||||
} |
|
||||||
$appointments = $appointments->paginate(20); |
|
||||||
$is_booked = $is_booked ?? null; |
|
||||||
$date = $date ?? null; |
|
||||||
$status = $status ?? null; |
|
||||||
$service = 'Migration|Visa'; |
|
||||||
return view($this->view . 'index', compact('appointments', 'service', 'is_booked', 'date', 'status')); |
|
||||||
} |
|
||||||
|
|
||||||
public function create() |
|
||||||
{ |
|
||||||
return view($this->view . 'create'); |
|
||||||
} |
|
||||||
|
|
||||||
public function store(Request $request) |
|
||||||
{ |
|
||||||
$request->validate([ |
|
||||||
'date' => 'required|date', |
|
||||||
'start_time' => 'required|date_format:H:i', |
|
||||||
'end_time' => 'required|date_format:H:i', |
|
||||||
]); |
|
||||||
$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'); |
|
||||||
|
|
||||||
$appointment = new Appointment([ |
|
||||||
'date' => $request->get('date'), |
|
||||||
'start_time' => $start_time, |
|
||||||
'end_time' => $end_time, |
|
||||||
'location' => $request->get('location'), |
|
||||||
'description' => $request->get('description'), |
|
||||||
'service_type' => $request->get('service_type'), |
|
||||||
]); |
|
||||||
|
|
||||||
$appointment->save(); |
|
||||||
if($request->get('service_type') == "1"){ |
|
||||||
$service = 'education'; |
|
||||||
}else{ |
|
||||||
$service = 'visa'; |
|
||||||
} |
|
||||||
|
|
||||||
return redirect($this->redirect.'/'.$service)->with('success', 'Appointment has been added'); |
|
||||||
} |
|
||||||
|
|
||||||
public function edit($id) |
|
||||||
{ |
|
||||||
$appointment = Appointment::findorfail($id); |
|
||||||
$start_time = explode(" ", $appointment->start_time); |
|
||||||
$start_time = $start_time[0]; |
|
||||||
|
|
||||||
$end_time = explode(" ", $appointment->end_time); |
|
||||||
$end_time = $end_time[0]; |
|
||||||
$appointment['start_time'] = $start_time; |
|
||||||
$appointment['end_time'] = $end_time; |
|
||||||
return view($this->view . 'edit', compact('appointment')); |
|
||||||
} |
|
||||||
|
|
||||||
public function update(Request $request, $id) |
|
||||||
{ |
|
||||||
|
|
||||||
$request->validate([ |
|
||||||
'date' => 'required|date', |
|
||||||
'start_time' => 'required|date_format:H:i', |
|
||||||
'end_time' => 'required|date_format:H:i', |
|
||||||
]); |
|
||||||
$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'); |
|
||||||
|
|
||||||
$appointment = Appointment::find($id); |
|
||||||
$appointment->date = $request->get('date'); |
|
||||||
$appointment->start_time = $start_time; |
|
||||||
$appointment->end_time = $end_time; |
|
||||||
$appointment->location = $request->get('location'); |
|
||||||
$appointment->description = $request->get('description'); |
|
||||||
$appointment->service_type = $request->get('service_type'); |
|
||||||
$appointment->status = $request->get('status'); |
|
||||||
$appointment->save(); |
|
||||||
if($request->get('service_type') == "1"){ |
|
||||||
$service = 'education'; |
|
||||||
}else{ |
|
||||||
$service = 'visa'; |
|
||||||
} |
|
||||||
|
|
||||||
return redirect($this->redirect.'/'.$service)->with('success', 'Appointment has been updated'); |
|
||||||
} |
|
||||||
|
|
||||||
public function show($id) |
|
||||||
{ |
|
||||||
$appointment = Appointment::with('appointment_booking_detail')->findorfail($id); |
|
||||||
|
|
||||||
return view($this->view . 'show', compact('appointment')); |
|
||||||
} |
|
||||||
|
|
||||||
public function destroy($id) |
|
||||||
{ |
|
||||||
$appointment = Appointment::find($id); |
|
||||||
$appointment->delete(); |
|
||||||
|
|
||||||
return redirect($this->redirect)->with('success', 'Appointment has been deleted'); |
|
||||||
} |
|
||||||
} |
|
@ -1,26 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace App\Http\Controllers; |
|
||||||
|
|
||||||
use Illuminate\Http\Request; |
|
||||||
|
|
||||||
class ImageUploadController extends Controller |
|
||||||
{ |
|
||||||
public function storeImage(Request $request) |
|
||||||
{ |
|
||||||
if ($request->hasFile('upload')) { |
|
||||||
$finfo = finfo_open(FILEINFO_MIME_TYPE); // Return MIME type a la the 'mimetype' extension |
|
||||||
$mimeType = finfo_file($finfo, $request->file('upload')); |
|
||||||
finfo_close($finfo); |
|
||||||
if ($mimeType == 'image/jpeg' || $mimeType == 'image/png' || $mimeType == 'image/svg+xml' || $mimeType == 'image/gif' || $mimeType == 'image/webp') { |
|
||||||
$originName = $request->file('upload')->getClientOriginalName(); |
|
||||||
$fileName = pathinfo($originName, PATHINFO_FILENAME); |
|
||||||
$extension = $request->file('upload')->getClientOriginalExtension(); |
|
||||||
$fileName = $fileName . '_' . time() . '.' . $extension; |
|
||||||
$request->file('upload')->move(public_path('images/media'), $fileName); |
|
||||||
$url = asset('images/media/' . $fileName); |
|
||||||
return response()->json(['fileName' => $fileName, 'uploaded'=> 1, 'url' => $url]); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -1,145 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace App\Http\Controllers; |
|
||||||
|
|
||||||
use Illuminate\Http\Request; |
|
||||||
use App\Models\Appointment; |
|
||||||
use Carbon\Carbon; |
|
||||||
use App\Models\AppointmentBookingDetail; |
|
||||||
|
|
||||||
class AppointmentController extends Controller |
|
||||||
{ |
|
||||||
public function index(){ |
|
||||||
|
|
||||||
$educationAppointments = Appointment::where('date', '>=', Carbon::today())->where('service_type', '1')->get(); |
|
||||||
$visaAppointments = Appointment::where('date', '>=', Carbon::today())->where('service_type', '2')->get(); |
|
||||||
// foreach($educationAppointments as $appointment){ |
|
||||||
// $startTime = Carbon::createFromFormat('H:i', $appointment->start_time); |
|
||||||
// $date = Carbon::createFromFormat('H:i', $appointment->start_time); |
|
||||||
// dd($date); |
|
||||||
// } |
|
||||||
return view('appointment', compact('educationAppointments', 'visaAppointments')); |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
public function get_appointment_by_date(Request $request){ |
|
||||||
|
|
||||||
$dateTime = $request->date; |
|
||||||
|
|
||||||
$date_parts = explode(" ", $dateTime); |
|
||||||
$month_number = date_parse($date_parts[1])['month']; |
|
||||||
$carbon = Carbon::createFromDate($date_parts[3], $month_number, $date_parts[2]); |
|
||||||
$date = $carbon->format('Y-m-d'); |
|
||||||
|
|
||||||
$type_id = $request->id; |
|
||||||
$appointments_all = Appointment::whereDate('date',$date)->where(['service_type' => $type_id,'is_booked' => false,'status' => 1])->get(); |
|
||||||
$old_date = Carbon::createFromFormat('Y-m-d', $date); |
|
||||||
$formated_date = $old_date->format('M d, Y'); |
|
||||||
$currentTime = Carbon::now(); |
|
||||||
$appointments = []; |
|
||||||
foreach ($appointments_all as $appointment) { |
|
||||||
$start_time = explode(" ", $appointment->start_time); |
|
||||||
$start_time = $start_time[0]; |
|
||||||
$appointmentDate = Carbon::createFromFormat('Y-m-d H:i', $appointment->date.' '.$start_time); |
|
||||||
if ($appointmentDate->gt($currentTime)) { |
|
||||||
array_push($appointments, $appointment); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
return response()->json(['appointment' => $appointments,'formated_date' => $formated_date]); |
|
||||||
} |
|
||||||
|
|
||||||
public function form_submit(Request $request){ |
|
||||||
|
|
||||||
$request->validate([ |
|
||||||
'name' => 'required', |
|
||||||
'email' => 'required|email', |
|
||||||
'phone' => 'required', |
|
||||||
]); |
|
||||||
$appointment_id = $request->get('appointment_id'); |
|
||||||
|
|
||||||
$appointment = Appointment::findorfail($appointment_id); |
|
||||||
$appointment_detail = new AppointmentBookingDetail(); |
|
||||||
$appointment_detail->name = $request->get('name'); |
|
||||||
$appointment_detail->email = $request->get('email'); |
|
||||||
$appointment_detail->phone = $request->get('phone'); |
|
||||||
$appointment_detail->notes = $request->get('notes'); |
|
||||||
$appointment_detail->appointment_id = $appointment_id; |
|
||||||
$email = $request['email']; |
|
||||||
$name = $request['name']; |
|
||||||
$phone = $request['phone']; |
|
||||||
|
|
||||||
if($appointment_detail->save()){ |
|
||||||
|
|
||||||
$date = Carbon::createFromFormat('Y-m-d', $appointment->date); |
|
||||||
$formated_date = $date->format('M d, Y'); |
|
||||||
$appointment->is_booked = true; |
|
||||||
$appointment->save(); |
|
||||||
$subject = 'Appointment Booked Successfully.'; |
|
||||||
dispatch(function() use ($name,$email,$phone,$subject,$formated_date,$appointment) { |
|
||||||
|
|
||||||
\Mail::send('appointment_confirmed', 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,$email,$name){ |
|
||||||
// $subject=($service!= '') ? 'Enquiry for '.$service : 'Contact/Feedback'; |
|
||||||
$message->subject($subject); |
|
||||||
// $message->from('admin@eteducation.com.au', 'Admin'); |
|
||||||
$message->to($email, $name)->subject($subject); |
|
||||||
// $message->cc('extratechweb@gmail.com', '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); |
|
||||||
|
|
||||||
}); |
|
||||||
|
|
||||||
|
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
return response()->json(['appointment_detail' => $appointment_detail,'appointment' => $appointment,'formated_date' => $formated_date],200); |
|
||||||
|
|
||||||
} |
|
||||||
} |
|
@ -1,21 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace App\Http\Controllers; |
|
||||||
|
|
||||||
use Illuminate\Http\Request; |
|
||||||
use App\Models\NewsAndUpdate; |
|
||||||
use App\Models\Page; |
|
||||||
|
|
||||||
class BlogController extends Controller |
|
||||||
{ |
|
||||||
public function index(){ |
|
||||||
$page = Page::where(['title' => 'Blogs','status' => 1])->first(); |
|
||||||
$blogs = NewsAndUpdate::where('status',1)->get(); |
|
||||||
return view('blogs',compact('blogs','page')); |
|
||||||
} |
|
||||||
|
|
||||||
public function blog_detail($slug){ |
|
||||||
$blog = NewsAndUpdate::where(['slug' => $slug, 'status' => 1])->first(); |
|
||||||
return view('blog-detail',compact('blog')); |
|
||||||
} |
|
||||||
} |
|
@ -1,64 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace App\Http\Controllers; |
|
||||||
|
|
||||||
use Illuminate\Http\Request; |
|
||||||
use App\Models\Contact; |
|
||||||
use App\Models\Page; |
|
||||||
|
|
||||||
class ContactController extends Controller |
|
||||||
{ |
|
||||||
public function index(){ |
|
||||||
$page = Page::where(['title' => 'Contact Us','status' => 1])->first(); |
|
||||||
return view('contact',compact('page')); |
|
||||||
} |
|
||||||
|
|
||||||
public function post_contact(Request $request){ |
|
||||||
|
|
||||||
$contact = new Contact(); |
|
||||||
$subject = 'Contact Enquiry'; |
|
||||||
// $check = ''; |
|
||||||
// if(isset($request['firstname'])){ |
|
||||||
// $subject = 'Quick Enquiry'; |
|
||||||
// $check = '1'; |
|
||||||
// } |
|
||||||
// $name = ($request['firstname'] != null) ? ($request['firstname'].' '.$request['lastname']) : $request['fullname'] ; |
|
||||||
|
|
||||||
$contact->fullname = $request['full_name']; |
|
||||||
$contact->email = $request['email']; |
|
||||||
$contact->phone = $request['phone']; |
|
||||||
$contact->message = $request['message']; |
|
||||||
$contact->nationality = $request['nationality']; |
|
||||||
|
|
||||||
$contact->save(); |
|
||||||
|
|
||||||
// dispatch(function() use ($check,$subject, $contact) { |
|
||||||
\Mail::send('contact_mail', array( |
|
||||||
|
|
||||||
'full_name' =>$request['full_name'], |
|
||||||
|
|
||||||
'email' =>$request['email'], |
|
||||||
|
|
||||||
'phone' =>$request['phone'], |
|
||||||
|
|
||||||
'nationality' =>$request['nationality'], |
|
||||||
|
|
||||||
'contact_message' =>$request['message'], |
|
||||||
|
|
||||||
'subject' =>$subject |
|
||||||
|
|
||||||
|
|
||||||
), function($message) use ($subject){ |
|
||||||
// $subject=($service!= '') ? 'Enquiry for '.$service : 'Contact/Feedback'; |
|
||||||
$message->subject($subject); |
|
||||||
$message->to('admin@eteducation.com.au', 'Et-Visa')->subject($subject); |
|
||||||
$message->cc('extratechweb@gmail.com', 'Extratech')->subject($subject); |
|
||||||
$message->cc('suman@extratechs.com.au', 'Extratech')->subject($subject); |
|
||||||
|
|
||||||
}); |
|
||||||
// }); |
|
||||||
// return redirect()->back()->with(['msg' => 'Successfully submitted.']); |
|
||||||
return redirect()->back()->with(['msg' => 'Thank you for your interest. We will get back to you soon.','status' =>'Ok'],200); |
|
||||||
|
|
||||||
} |
|
||||||
} |
|
@ -1,76 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace App\Http\Controllers; |
|
||||||
|
|
||||||
use App\Jobs\SendEnquiryMailJob; |
|
||||||
use App\Models\Country; |
|
||||||
use App\Models\Enquiry; |
|
||||||
use Illuminate\Http\Request; |
|
||||||
use Illuminate\Support\Facades\DB; |
|
||||||
use Illuminate\Support\Facades\Session; |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class EnquiryController extends Controller |
|
||||||
{ |
|
||||||
public function form() |
|
||||||
{ |
|
||||||
$countries = Country::all(); |
|
||||||
return view('enquiry-form', compact('countries')); |
|
||||||
} |
|
||||||
|
|
||||||
public function submit(Request $request) |
|
||||||
{ |
|
||||||
$work_experience = $request->get('work_experience'); |
|
||||||
if ($work_experience == 'no') { |
|
||||||
$request['work_experience_details'] = null; |
|
||||||
$request['salary_mode'] = null; |
|
||||||
} |
|
||||||
$marital_status = $request->get('marital_status'); |
|
||||||
if ($marital_status == 'Widow' || $marital_status == 'Single') { |
|
||||||
$request['married_date'] = null; |
|
||||||
$request['spouse_academics'] = null; |
|
||||||
$request['spouse_work_experience'] = null; |
|
||||||
$request['spouse_salary_mode'] = null; |
|
||||||
} |
|
||||||
DB::beginTransaction(); |
|
||||||
try { |
|
||||||
$enquiry = Enquiry::create($request->all()); |
|
||||||
} catch (\Exception $e) { |
|
||||||
DB::rollback(); |
|
||||||
return redirect()->back()->with(['msg' => 'Something went wrong. Please try again!', 'status' => false], 400); |
|
||||||
} |
|
||||||
DB::commit(); |
|
||||||
dispatch(new SendEnquiryMailJob($enquiry)); |
|
||||||
return redirect()->back()->with(['msg' => 'We have recieved your enquiry. You will be contacted soon!', 'status' => true], 200); |
|
||||||
} |
|
||||||
|
|
||||||
public function index() |
|
||||||
{ |
|
||||||
|
|
||||||
$enquiries = Enquiry::orderBy('id', 'DESC'); |
|
||||||
if (\request('name')) { |
|
||||||
$key = \request('name'); |
|
||||||
$enquiries = $enquiries->where('first_name', 'like', $key . '%'); |
|
||||||
} |
|
||||||
if (\request('email')) { |
|
||||||
$key = \request('email'); |
|
||||||
$enquiries = $enquiries->where('email', 'like', $key . '%'); |
|
||||||
} |
|
||||||
$enquiries = $enquiries->paginate(30); |
|
||||||
return view('admin.enquiry.index', compact('enquiries')); |
|
||||||
} |
|
||||||
|
|
||||||
public function show($id) |
|
||||||
{ |
|
||||||
$enquiry = Enquiry::findorfail($id); |
|
||||||
return view('admin.enquiry.show', compact('enquiry')); |
|
||||||
} |
|
||||||
public function delete($id) |
|
||||||
{ |
|
||||||
$enquiry = Enquiry::findorfail($id); |
|
||||||
$enquiry->delete(); |
|
||||||
Session::flash('success', 'Enquiry has been successfully deleted!'); |
|
||||||
return redirect('admin/enquiries'); |
|
||||||
} |
|
||||||
} |
|
@ -1,16 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace App\Http\Controllers; |
|
||||||
|
|
||||||
use Illuminate\Http\Request; |
|
||||||
use App\Models\Faq; |
|
||||||
use App\Models\Page; |
|
||||||
|
|
||||||
class FaqController extends Controller |
|
||||||
{ |
|
||||||
public function index(){ |
|
||||||
$page = Page::where(['title' => 'FAQ','status' => 1])->first(); |
|
||||||
$faqs = Faq::where('status',true)->get(); |
|
||||||
return view('faq',compact('faqs','page')); |
|
||||||
} |
|
||||||
} |
|
@ -1,26 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace App\Http\Controllers; |
|
||||||
|
|
||||||
use Illuminate\Http\Request; |
|
||||||
|
|
||||||
class ImageUploadController extends Controller |
|
||||||
{ |
|
||||||
public function storeImage(Request $request) |
|
||||||
{ |
|
||||||
if ($request->hasFile('upload')) { |
|
||||||
$finfo = finfo_open(FILEINFO_MIME_TYPE); // Return MIME type a la the 'mimetype' extension |
|
||||||
$mimeType = finfo_file($finfo, $request->file('upload')); |
|
||||||
finfo_close($finfo); |
|
||||||
if ($mimeType == 'image/jpeg' || $mimeType == 'image/png' || $mimeType == 'image/svg+xml' || $mimeType == 'image/gif' || $mimeType == 'image/webp') { |
|
||||||
$originName = $request->file('upload')->getClientOriginalName(); |
|
||||||
$fileName = pathinfo($originName, PATHINFO_FILENAME); |
|
||||||
$extension = $request->file('upload')->getClientOriginalExtension(); |
|
||||||
$fileName = $fileName . '_' . time() . '.' . $extension; |
|
||||||
$request->file('upload')->move(public_path('images/media'), $fileName); |
|
||||||
$url = asset('images/media/' . $fileName); |
|
||||||
return response()->json(['fileName' => $fileName, 'uploaded'=> 1, 'url' => $url]); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -1,21 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace App\Http\Controllers; |
|
||||||
|
|
||||||
use Illuminate\Http\Request; |
|
||||||
use App\Models\Service; |
|
||||||
use App\Models\Page; |
|
||||||
|
|
||||||
class StudyAbroadController extends Controller |
|
||||||
{ |
|
||||||
public function study_abroad(){ |
|
||||||
$page = Page::where(['title' => 'Study Abroad','status' => 1])->first(); |
|
||||||
$services = Service::with('service_sections')->get(); |
|
||||||
return view('study-abroad',compact('services','page')); |
|
||||||
} |
|
||||||
|
|
||||||
public function details($slug){ |
|
||||||
$service = Service::where(['slug' => $slug,'status' => 1])->orderby('order_by','asc')->first(); |
|
||||||
return view('study-abroad-detail',compact('service')); |
|
||||||
} |
|
||||||
} |
|
@ -1,25 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace App\Http\Controllers; |
|
||||||
|
|
||||||
use Illuminate\Http\Request; |
|
||||||
use App\Models\VisaService; |
|
||||||
use App\Models\Page; |
|
||||||
|
|
||||||
class VisaController extends Controller |
|
||||||
{ |
|
||||||
|
|
||||||
public function index() |
|
||||||
{ |
|
||||||
$page = Page::where(['title' => 'Visa', 'status' => 1])->first(); |
|
||||||
$visas = VisaService::where('status', 1)->get(); |
|
||||||
return view('visa', compact('visas', 'pages')); |
|
||||||
} |
|
||||||
public function details($slug) |
|
||||||
{ |
|
||||||
$page = Page::where(['title' => 'Visa', 'status' => 1])->first(); |
|
||||||
$visas = VisaService::where('status', 1)->get(); |
|
||||||
$service = VisaService::where(['slug' => $slug, 'status' => 1])->orderby('order_by', 'asc')->first(); |
|
||||||
return view('visa', compact('service', 'page', 'visas')); |
|
||||||
} |
|
||||||
} |
|
@ -1,41 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace App\Jobs; |
|
||||||
|
|
||||||
use App\Mail\EnquiryMail; |
|
||||||
use App\Models\Setting; |
|
||||||
use Illuminate\Bus\Queueable; |
|
||||||
use Illuminate\Contracts\Queue\ShouldBeUnique; |
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue; |
|
||||||
use Illuminate\Foundation\Bus\Dispatchable; |
|
||||||
use Illuminate\Queue\InteractsWithQueue; |
|
||||||
use Illuminate\Queue\SerializesModels; |
|
||||||
use Illuminate\Support\Facades\Mail; |
|
||||||
|
|
||||||
class SendEnquiryMailJob implements ShouldQueue |
|
||||||
{ |
|
||||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; |
|
||||||
|
|
||||||
/** |
|
||||||
* Create a new job instance. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
protected $enquiry; |
|
||||||
public function __construct($enquiry) |
|
||||||
{ |
|
||||||
$this->enquiry = $enquiry; |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Execute the job. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function handle() |
|
||||||
{ |
|
||||||
$email = Setting::where('key', 'email')->get('value')->first()->value; |
|
||||||
|
|
||||||
Mail::to($email)->send(new EnquiryMail($this->enquiry)); |
|
||||||
} |
|
||||||
} |
|
@ -1,65 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace App\Mail; |
|
||||||
|
|
||||||
use Illuminate\Bus\Queueable; |
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue; |
|
||||||
use Illuminate\Mail\Mailable; |
|
||||||
use Illuminate\Mail\Mailables\Content; |
|
||||||
use Illuminate\Mail\Mailables\Envelope; |
|
||||||
use Illuminate\Queue\SerializesModels; |
|
||||||
|
|
||||||
class EnquiryMail extends Mailable |
|
||||||
{ |
|
||||||
use Queueable, SerializesModels; |
|
||||||
|
|
||||||
/** |
|
||||||
* Create a new message instance. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
* |
|
||||||
*/ |
|
||||||
protected $enquiry; |
|
||||||
|
|
||||||
public function __construct($enquiry) |
|
||||||
{ |
|
||||||
$this->enquiry = $enquiry; |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Get the message envelope. |
|
||||||
* |
|
||||||
* @return \Illuminate\Mail\Mailables\Envelope |
|
||||||
*/ |
|
||||||
public function envelope() |
|
||||||
{ |
|
||||||
return new Envelope( |
|
||||||
subject: 'Enquiry Mail', |
|
||||||
); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Get the message content definition. |
|
||||||
* |
|
||||||
* @return \Illuminate\Mail\Mailables\Content |
|
||||||
*/ |
|
||||||
public function content() |
|
||||||
{ |
|
||||||
return new Content( |
|
||||||
view: 'enquiry_mail', |
|
||||||
with: [ |
|
||||||
'enquiry' => $this->enquiry, |
|
||||||
], |
|
||||||
); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Get the attachments for the message. |
|
||||||
* |
|
||||||
* @return array |
|
||||||
*/ |
|
||||||
public function attachments() |
|
||||||
{ |
|
||||||
return []; |
|
||||||
} |
|
||||||
} |
|
@ -1,17 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace App\Models; |
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory; |
|
||||||
use Illuminate\Database\Eloquent\Model; |
|
||||||
|
|
||||||
class Appointment extends Model |
|
||||||
{ |
|
||||||
use HasFactory; |
|
||||||
|
|
||||||
protected $guarded = ['id']; |
|
||||||
|
|
||||||
public function appointment_booking_detail(){ |
|
||||||
return $this->hasOne(AppointmentBookingDetail::class); |
|
||||||
} |
|
||||||
} |
|
@ -1,15 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace App\Models; |
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory; |
|
||||||
use Illuminate\Database\Eloquent\Model; |
|
||||||
|
|
||||||
class AppointmentBookingDetail extends Model |
|
||||||
{ |
|
||||||
use HasFactory; |
|
||||||
|
|
||||||
public function appointment(){ |
|
||||||
return $this->belongsTo(Appointment::class); |
|
||||||
} |
|
||||||
} |
|
@ -1,11 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace App\Models; |
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory; |
|
||||||
use Illuminate\Database\Eloquent\Model; |
|
||||||
|
|
||||||
class Country extends Model |
|
||||||
{ |
|
||||||
use HasFactory; |
|
||||||
} |
|
@ -1,13 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace App\Models; |
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory; |
|
||||||
use Illuminate\Database\Eloquent\Model; |
|
||||||
|
|
||||||
class Enquiry extends Model |
|
||||||
{ |
|
||||||
use HasFactory; |
|
||||||
|
|
||||||
protected $guarded = ['id']; |
|
||||||
} |
|
@ -1,12 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace App\Models; |
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory; |
|
||||||
use Illuminate\Database\Eloquent\Model; |
|
||||||
|
|
||||||
class Faq extends Model |
|
||||||
{ |
|
||||||
use HasFactory; |
|
||||||
protected $guarded = ['id']; |
|
||||||
} |
|
@ -1,32 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration; |
|
||||||
use Illuminate\Database\Schema\Blueprint; |
|
||||||
use Illuminate\Support\Facades\Schema; |
|
||||||
|
|
||||||
return new class extends Migration |
|
||||||
{ |
|
||||||
/** |
|
||||||
* Run the migrations. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function up() |
|
||||||
{ |
|
||||||
Schema::table('contacts', function (Blueprint $table) { |
|
||||||
$table->string('nationality')->nullable(); |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Reverse the migrations. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function down() |
|
||||||
{ |
|
||||||
Schema::table('contacts', function (Blueprint $table) { |
|
||||||
// |
|
||||||
}); |
|
||||||
} |
|
||||||
}; |
|
@ -1,32 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration; |
|
||||||
use Illuminate\Database\Schema\Blueprint; |
|
||||||
use Illuminate\Support\Facades\Schema; |
|
||||||
|
|
||||||
return new class extends Migration |
|
||||||
{ |
|
||||||
/** |
|
||||||
* Run the migrations. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function up() |
|
||||||
{ |
|
||||||
Schema::table('about_us', function (Blueprint $table) { |
|
||||||
$table->longText('bottom_description')->nullable(); |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Reverse the migrations. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function down() |
|
||||||
{ |
|
||||||
Schema::table('about_us', function (Blueprint $table) { |
|
||||||
// |
|
||||||
}); |
|
||||||
} |
|
||||||
}; |
|
@ -1,37 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration; |
|
||||||
use Illuminate\Database\Schema\Blueprint; |
|
||||||
use Illuminate\Support\Facades\Schema; |
|
||||||
|
|
||||||
return new class extends Migration |
|
||||||
{ |
|
||||||
/** |
|
||||||
* Run the migrations. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function up() |
|
||||||
{ |
|
||||||
Schema::create('pages', function (Blueprint $table) { |
|
||||||
$table->id(); |
|
||||||
$table->string('banner_image')->nullable(); |
|
||||||
$table->string('title'); |
|
||||||
$table->string('sub_title')->nullable(); |
|
||||||
$table->longText('description')->nullable(); |
|
||||||
$table->longText('sub_description')->nullable(); |
|
||||||
$table->enum('status',['1','2']); |
|
||||||
$table->timestamps(); |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Reverse the migrations. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function down() |
|
||||||
{ |
|
||||||
Schema::dropIfExists('pages'); |
|
||||||
} |
|
||||||
}; |
|
@ -1,36 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration; |
|
||||||
use Illuminate\Database\Schema\Blueprint; |
|
||||||
use Illuminate\Support\Facades\Schema; |
|
||||||
|
|
||||||
return new class extends Migration |
|
||||||
{ |
|
||||||
/** |
|
||||||
* Run the migrations. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function up() |
|
||||||
{ |
|
||||||
Schema::create('faqs', function (Blueprint $table) { |
|
||||||
$table->id(); |
|
||||||
$table->bigInteger('service_id')->unsigned()->nullable(); |
|
||||||
$table->foreign('service_id')->references('id')->on('services'); |
|
||||||
$table->longText('question'); |
|
||||||
$table->longText('answer'); |
|
||||||
$table->enum('status',[1,2]); |
|
||||||
$table->timestamps(); |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Reverse the migrations. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function down() |
|
||||||
{ |
|
||||||
Schema::dropIfExists('faqs'); |
|
||||||
} |
|
||||||
}; |
|
@ -1,37 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration; |
|
||||||
use Illuminate\Database\Schema\Blueprint; |
|
||||||
use Illuminate\Support\Facades\Schema; |
|
||||||
|
|
||||||
return new class extends Migration |
|
||||||
{ |
|
||||||
/** |
|
||||||
* Run the migrations. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function up() |
|
||||||
{ |
|
||||||
Schema::create('appointments', function (Blueprint $table) { |
|
||||||
$table->id(); |
|
||||||
$table->date('date'); |
|
||||||
$table->string('start_time'); |
|
||||||
$table->string('end_time'); |
|
||||||
$table->string('location')->nullable(); |
|
||||||
$table->string('description')->nullable(); |
|
||||||
$table->enum('status',[1,2]); |
|
||||||
$table->timestamps(); |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Reverse the migrations. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function down() |
|
||||||
{ |
|
||||||
Schema::dropIfExists('appointments'); |
|
||||||
} |
|
||||||
}; |
|
@ -1,32 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration; |
|
||||||
use Illuminate\Database\Schema\Blueprint; |
|
||||||
use Illuminate\Support\Facades\Schema; |
|
||||||
|
|
||||||
return new class extends Migration |
|
||||||
{ |
|
||||||
/** |
|
||||||
* Run the migrations. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function up() |
|
||||||
{ |
|
||||||
Schema::table('appointments', function (Blueprint $table) { |
|
||||||
$table->enum('service_type',[1,2]); |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Reverse the migrations. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function down() |
|
||||||
{ |
|
||||||
Schema::table('appointments', function (Blueprint $table) { |
|
||||||
// |
|
||||||
}); |
|
||||||
} |
|
||||||
}; |
|
@ -1,32 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration; |
|
||||||
use Illuminate\Database\Schema\Blueprint; |
|
||||||
use Illuminate\Support\Facades\Schema; |
|
||||||
|
|
||||||
return new class extends Migration |
|
||||||
{ |
|
||||||
/** |
|
||||||
* Run the migrations. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function up() |
|
||||||
{ |
|
||||||
Schema::table('appointments', function (Blueprint $table) { |
|
||||||
$table->boolean('is_booked')->default(false); |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Reverse the migrations. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function down() |
|
||||||
{ |
|
||||||
Schema::table('appointments', function (Blueprint $table) { |
|
||||||
// |
|
||||||
}); |
|
||||||
} |
|
||||||
}; |
|
@ -1,37 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration; |
|
||||||
use Illuminate\Database\Schema\Blueprint; |
|
||||||
use Illuminate\Support\Facades\Schema; |
|
||||||
|
|
||||||
return new class extends Migration |
|
||||||
{ |
|
||||||
/** |
|
||||||
* Run the migrations. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function up() |
|
||||||
{ |
|
||||||
Schema::create('appointment_booking_details', function (Blueprint $table) { |
|
||||||
$table->id(); |
|
||||||
$table->bigInteger('appointment_id')->unsigned(); |
|
||||||
$table->foreign('appointment_id')->references('id')->on('appointments')->onDelete('cascade'); |
|
||||||
$table->string('name'); |
|
||||||
$table->string('email')->nullable(); |
|
||||||
$table->string('phone'); |
|
||||||
$table->string('notes')->nullable(); |
|
||||||
$table->timestamps(); |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Reverse the migrations. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function down() |
|
||||||
{ |
|
||||||
Schema::dropIfExists('appointment_booking_details'); |
|
||||||
} |
|
||||||
}; |
|
@ -1,59 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration; |
|
||||||
use Illuminate\Database\Schema\Blueprint; |
|
||||||
use Illuminate\Support\Facades\Schema; |
|
||||||
|
|
||||||
return new class extends Migration |
|
||||||
{ |
|
||||||
/** |
|
||||||
* Run the migrations. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function up() |
|
||||||
{ |
|
||||||
Schema::create('enquiries', function (Blueprint $table) { |
|
||||||
$table->id(); |
|
||||||
$table->string('first_name'); |
|
||||||
$table->string('middle_name')->nullable(); |
|
||||||
$table->string('last_name'); |
|
||||||
$table->date('dob'); |
|
||||||
$table->string('cob'); |
|
||||||
$table->string('gender'); |
|
||||||
$table->string('email'); |
|
||||||
$table->string('phone'); |
|
||||||
$table->string('address'); |
|
||||||
$table->string('highest_qualification'); |
|
||||||
$table->string('stream')->nullable(); |
|
||||||
$table->string('gpa'); |
|
||||||
$table->string('graduate_year'); |
|
||||||
$table->string('gap')->nullable(); |
|
||||||
$table->string('current_status')->nullable(); |
|
||||||
$table->string('work_experience'); |
|
||||||
$table->text('work_experience_details')->nullable(); |
|
||||||
$table->string('salary_mode')->nullable(); |
|
||||||
$table->string('test_score')->nullable(); |
|
||||||
$table->string('marital_status'); |
|
||||||
$table->string('married_date')->nullable(); |
|
||||||
$table->string('spouse_academics')->nullable(); |
|
||||||
$table->string('spouse_work_experience')->nullable(); |
|
||||||
$table->string('spouse_salary_mode')->nullable(); |
|
||||||
$table->string('immigration_history')->nullable(); |
|
||||||
$table->string('desired_study_field')->nullable(); |
|
||||||
$table->string('desired_location')->nullable(); |
|
||||||
$table->boolean('status')->default(true); |
|
||||||
$table->timestamps(); |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* Reverse the migrations. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function down() |
|
||||||
{ |
|
||||||
Schema::dropIfExists('enquiries'); |
|
||||||
} |
|
||||||
}; |
|
@ -1,49 +0,0 @@ |
|||||||
<?php |
|
||||||
|
|
||||||
namespace Database\Seeders; |
|
||||||
|
|
||||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents; |
|
||||||
use Illuminate\Database\Seeder; |
|
||||||
use App\Models\Appointment; |
|
||||||
use Carbon\Carbon; |
|
||||||
use Carbon\CarbonInterval; |
|
||||||
use Illuminate\Support\Facades\DB; |
|
||||||
|
|
||||||
|
|
||||||
class AppointmentTableSeeder extends Seeder |
|
||||||
{ |
|
||||||
/** |
|
||||||
* Run the database seeds. |
|
||||||
* |
|
||||||
* @return void |
|
||||||
*/ |
|
||||||
public function run() |
|
||||||
{ |
|
||||||
|
|
||||||
$latestAppointment = DB::table('appointments')->latest('date')->first(); |
|
||||||
$startDate = $latestAppointment ? Carbon::parse($latestAppointment->date)->addDay() : Carbon::now(); |
|
||||||
|
|
||||||
$startTime = Carbon::parse("9:00 AM"); |
|
||||||
$endTime = Carbon::parse("5:00 PM"); |
|
||||||
|
|
||||||
foreach(config('custom.service_type') as $key => $value){ |
|
||||||
|
|
||||||
for ($i = 0; $i < 7; $i++) { |
|
||||||
$date = $startDate->copy()->addDays($i); |
|
||||||
for ($j = 0; $j <= ((($endTime->diffInMinutes($startTime)) / 30)-1); $j++) { |
|
||||||
|
|
||||||
$currentTime = $startTime->copy()->addMinutes(30 * $j); |
|
||||||
$currentEndTime = $startTime->copy()->addMinutes(30 * $j + 30); |
|
||||||
|
|
||||||
DB::table('appointments')->insert([ |
|
||||||
'date' => $date, |
|
||||||
'start_time' => $currentTime->format("H:i A"), |
|
||||||
'end_time' => $currentEndTime->format("H:i A"), |
|
||||||
'service_type' => $key |
|
||||||
]); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
} |
|
Before Width: | Height: | Size: 460 KiB |
Before Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 2.6 MiB |
Before Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 460 KiB |
Before Width: | Height: | Size: 389 KiB |
Before Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 460 KiB |
Before Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 717 KiB |
Before Width: | Height: | Size: 460 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 478 B |
Before Width: | Height: | Size: 784 B After Width: | Height: | Size: 399 B |
Before Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 429 B |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 412 KiB |
Before Width: | Height: | Size: 618 B |