Compare commits
46 Commits
Author | SHA1 | Date |
---|---|---|
Mahesh Sharma | 564529895f | 2 years ago |
Mahesh Sharma | cce8fd095a | 2 years ago |
tribikram | f860a36947 | 2 years ago |
Mahesh Sharma | 67612b1116 | 2 years ago |
tribikram | e269f8c285 | 2 years ago |
tribikram | a898a3fa78 | 2 years ago |
Mahesh Sharma | ca9688fb69 | 2 years ago |
Mahesh Sharma | f461b09d08 | 2 years ago |
tribikram | 401c406444 | 2 years ago |
tribikram | 6a0a4ccb34 | 2 years ago |
Mahesh Sharma | f2d67186be | 2 years ago |
Mahesh Sharma | 7f836f06c2 | 2 years ago |
Mahesh Sharma | 338d015069 | 2 years ago |
tribikram | 948b076c03 | 2 years ago |
tribikram | 1821580633 | 2 years ago |
tribikram | cf212411de | 2 years ago |
Mahesh Sharma | 4201b17cab | 2 years ago |
Mahesh Sharma | c5d88c4d03 | 2 years ago |
Mahesh Sharma | 92b515bd80 | 2 years ago |
tribikram | b3aaa90f34 | 2 years ago |
Mahesh Sharma | e1eb4fa70c | 2 years ago |
Mahesh Sharma | ed3918d02a | 2 years ago |
tribikram | 4a305d6a92 | 2 years ago |
tribikram | c4b87ab6c0 | 2 years ago |
tribikram | 3940ca697f | 2 years ago |
Mahesh Sharma | e7b33f2ccc | 2 years ago |
tribikram | 2520f2017b | 2 years ago |
Mahesh Sharma | e3210482fa | 2 years ago |
Mahesh Sharma | d310c517c1 | 2 years ago |
tribikram | c717c2cfe8 | 2 years ago |
tribikram | f8932a97c2 | 2 years ago |
Mahesh Sharma | f6118eeb1f | 2 years ago |
tribikram | ca5565d448 | 2 years ago |
tribikram | f5be1c14a7 | 2 years ago |
Mahesh Sharma | 98fb64971a | 2 years ago |
Mahesh Sharma | 45d0b8f609 | 2 years ago |
tribikram | c8f0fe2d1e | 2 years ago |
tribikram | f977c3ddb0 | 2 years ago |
Mahesh Sharma | 0c5354f9ce | 2 years ago |
Mahesh Sharma | 6023ac6817 | 2 years ago |
Mahesh Sharma | 3f2850b8d1 | 2 years ago |
suman | 25a9be6e1c | 2 years ago |
Mahesh Sharma | f053ba81b5 | 2 years ago |
Mahesh Sharma | 637e49f574 | 2 years ago |
Mahesh Sharma | 7952068dad | 2 years ago |
Mahesh Sharma | 7178c37eba | 2 years ago |
@ -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 |
||||
} |
||||
} |
@ -1,278 +0,0 @@ |
||||
<?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]); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
@ -0,0 +1,76 @@ |
||||
<?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'); |
||||
} |
||||
} |
@ -0,0 +1,41 @@ |
||||
<?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)); |
||||
} |
||||
} |
@ -0,0 +1,65 @@ |
||||
<?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 []; |
||||
} |
||||
} |
@ -0,0 +1,15 @@ |
||||
<?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); |
||||
} |
||||
} |
@ -0,0 +1,11 @@ |
||||
<?php |
||||
|
||||
namespace App\Models; |
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory; |
||||
use Illuminate\Database\Eloquent\Model; |
||||
|
||||
class Country extends Model |
||||
{ |
||||
use HasFactory; |
||||
} |
@ -0,0 +1,13 @@ |
||||
<?php |
||||
|
||||
namespace App\Models; |
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory; |
||||
use Illuminate\Database\Eloquent\Model; |
||||
|
||||
class Enquiry extends Model |
||||
{ |
||||
use HasFactory; |
||||
|
||||
protected $guarded = ['id']; |
||||
} |
@ -0,0 +1,32 @@ |
||||
<?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) { |
||||
// |
||||
}); |
||||
} |
||||
}; |
@ -0,0 +1,37 @@ |
||||
<?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'); |
||||
} |
||||
}; |
@ -0,0 +1,59 @@ |
||||
<?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'); |
||||
} |
||||
}; |
@ -0,0 +1,49 @@ |
||||
<?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 |
After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 389 KiB After Width: | Height: | Size: 389 KiB |
After Width: | Height: | Size: 1.0 MiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 394 KiB |
Before Width: | Height: | Size: 394 KiB |
Before Width: | Height: | Size: 2.4 MiB |
Before Width: | Height: | Size: 460 KiB |
Before Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 389 KiB |
Before Width: | Height: | Size: 389 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 441 KiB After Width: | Height: | Size: 441 KiB |
Before Width: | Height: | Size: 441 KiB After Width: | Height: | Size: 441 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 441 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 441 KiB |
After Width: | Height: | Size: 441 KiB |
After Width: | Height: | Size: 441 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 500 KiB |
After Width: | Height: | Size: 431 KiB |
After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 389 KiB After Width: | Height: | Size: 389 KiB |
After Width: | Height: | Size: 572 KiB |
After Width: | Height: | Size: 610 KiB |
After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 389 KiB |
Before Width: | Height: | Size: 389 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 932 KiB |
After Width: | Height: | Size: 572 KiB |
After Width: | Height: | Size: 431 KiB |
After Width: | Height: | Size: 405 KiB |
After Width: | Height: | Size: 441 KiB |
After Width: | Height: | Size: 8.2 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 580 KiB |
After Width: | Height: | Size: 11 KiB |