From cdef2abe1d565c8a4e09763b24ddf0b91215bf86 Mon Sep 17 00:00:00 2001 From: Mahesh Sharma Date: Wed, 7 Dec 2022 15:07:57 +0545 Subject: [PATCH] quick-enquiry-section-and-header-footer-update --- .../Controllers/Admin/SliderController.php | 13 ++--- app/Http/Controllers/HomeController.php | 22 +++---- .../2022_09_20_184931_create_jobs_table.php | 36 ++++++++++++ resources/views/admin/slider/create.blade.php | 4 +- resources/views/admin/slider/edit.blade.php | 4 +- resources/views/admin/slider/index.blade.php | 11 +--- resources/views/contact_mail.blade.php | 29 ++++++++++ resources/views/layout/app.blade.php | 27 ++++++--- resources/views/welcome.blade.php | 58 +++++++++++++------ routes/web.php | 2 +- 10 files changed, 151 insertions(+), 55 deletions(-) create mode 100644 database/migrations/2022_09_20_184931_create_jobs_table.php create mode 100644 resources/views/contact_mail.blade.php diff --git a/app/Http/Controllers/Admin/SliderController.php b/app/Http/Controllers/Admin/SliderController.php index 4f90b0a..2d2a388 100644 --- a/app/Http/Controllers/Admin/SliderController.php +++ b/app/Http/Controllers/Admin/SliderController.php @@ -54,9 +54,9 @@ class SliderController extends Controller { $this->validate(\request(),[ 'title1' => 'required', - // 'title2' => 'required', - // 'description' => 'required', - 'image' => 'required|file|mimes:jpeg,png,jpg', + 'title2' => 'required', + 'description' => 'required', + // 'image' => 'required|file|mimes:jpeg,png,jpg', 'status' => 'required' ]); @@ -121,10 +121,9 @@ class SliderController extends Controller $this->validate(\request(),[ 'title1' => 'required', - // 'title1' => 'required', - // 'title2' => 'required', - // 'description' => 'required', - 'image' => 'file|mimes:jpeg,png,jpg', + 'title2' => 'required', + 'description' => 'required', + // 'image' => 'file|mimes:jpeg,png,jpg', 'status' => 'required' ]); diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index a4ab583..3a093fe 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -74,7 +74,7 @@ class HomeController extends Controller public function send_contact_mail(Request $request){ $contact = new Contact(); - $subject = 'Contact Enquiry'; + $subject = 'Quick Enquiry'; $check = ''; if(isset($request['firstname'])){ $subject = 'Quick Enquiry'; @@ -87,14 +87,14 @@ class HomeController extends Controller $contact->phone = $request['phone']; $contact->message = $request['message']; - - // if($request->service_id != null){ - // $service = Service::find($request['service_id'])->name ; - // $contact->service_id = $request['service_id']; - // } + $service = ''; + if($request->service_id != null){ + $service = Service::find($request['service_id'])->name ; + $contact->service_id = $request['service_id']; + } $contact->save(); - dispatch(function() use ($check,$subject, $contact) { + dispatch(function() use ($check,$subject, $contact,$service) { \Mail::send('contact_mail', array( 'full_name' =>$contact['fullname'], @@ -107,7 +107,9 @@ class HomeController extends Controller 'subject' =>$subject , - 'check' => $check ?? '' + 'check' => $check ?? '', + + 'service' => $service ?? '' ), function($message) use ($subject){ // $subject=($service!= '') ? 'Enquiry for '.$service : 'Contact/Feedback'; @@ -118,8 +120,8 @@ class HomeController extends Controller }); }); - - return response()->json(['success' => 'Thank you for your interest. We will get back to you soon.','status' =>'Ok'],200); + return redirect()->back()->with(['success' => 'Thank you for your interest. We will get back to you soon.']); + // return response()->json(['success' => 'Thank you for your interest. We will get back to you soon.','status' =>'Ok'],200); } diff --git a/database/migrations/2022_09_20_184931_create_jobs_table.php b/database/migrations/2022_09_20_184931_create_jobs_table.php new file mode 100644 index 0000000..1be9e8a --- /dev/null +++ b/database/migrations/2022_09_20_184931_create_jobs_table.php @@ -0,0 +1,36 @@ +bigIncrements('id'); + $table->string('queue')->index(); + $table->longText('payload'); + $table->unsignedTinyInteger('attempts'); + $table->unsignedInteger('reserved_at')->nullable(); + $table->unsignedInteger('available_at'); + $table->unsignedInteger('created_at'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('jobs'); + } +} diff --git a/resources/views/admin/slider/create.blade.php b/resources/views/admin/slider/create.blade.php index 12abe4d..2dfa3d4 100644 --- a/resources/views/admin/slider/create.blade.php +++ b/resources/views/admin/slider/create.blade.php @@ -43,7 +43,7 @@ -
+
diff --git a/resources/views/admin/slider/edit.blade.php b/resources/views/admin/slider/edit.blade.php index 10c45ce..447c3c4 100644 --- a/resources/views/admin/slider/edit.blade.php +++ b/resources/views/admin/slider/edit.blade.php @@ -49,7 +49,7 @@
-
+
diff --git a/resources/views/admin/slider/index.blade.php b/resources/views/admin/slider/index.blade.php index c76bebb..8952a20 100644 --- a/resources/views/admin/slider/index.blade.php +++ b/resources/views/admin/slider/index.blade.php @@ -55,8 +55,8 @@ Header Subheader Description - Image - ImageAlt + Status Action @@ -68,12 +68,7 @@ {{$setting->title1}} {{$setting->title2}} {!! $setting->description !!} - - - - - - {{$setting->image_alt}} + {{config('custom.status')[$setting->status]}} diff --git a/resources/views/contact_mail.blade.php b/resources/views/contact_mail.blade.php new file mode 100644 index 0000000..ae642cb --- /dev/null +++ b/resources/views/contact_mail.blade.php @@ -0,0 +1,29 @@ + + + +

@if($check !== '') Contact Details @else Quick Enquiry Details @endif

+
+
+
+

Please, find out the @if(($check !== '')) contact @else quick enquiry @endif details

+ Full Name: {{ $full_name }}

+ Email: {{ $email }}

+ Phone: {{$phone}}

+ @if($service !== '') + Service: {{$service}}

+ @endif + Message: {{ $contact_message }}

+ + + +
+
+ diff --git a/resources/views/layout/app.blade.php b/resources/views/layout/app.blade.php index d944fa3..d84b031 100644 --- a/resources/views/layout/app.blade.php +++ b/resources/views/layout/app.blade.php @@ -58,16 +58,28 @@
+ @php + $services = \App\Models\Service::where('status','1')->orderByRaw('CONVERT(order_by, SIGNED) asc')->get(); + $facebook = App\Models\Setting::where(['slug' => 'facebook-link','status' => true])->first(); + $instagram = App\Models\Setting::where(['slug' => 'instagram-link','status' => true])->first(); + $linkedIn = App\Models\Setting::where(['slug' => 'linkedin-link','status' => true])->first(); + @endphp
@@ -91,11 +103,10 @@
diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index fbbffcf..40e6d22 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -3,6 +3,9 @@ Aplus Agency @endsection @section('content') + @php + $msg = Session::get('msg') ?? null; + @endphp
@@ -269,7 +278,8 @@

Quick Enquiry

Want to get in touch? Please fill in the form below and one of our agents will be in touch with you shortly.

-
+ + @csrf
@@ -278,7 +288,7 @@
- +
@@ -288,7 +298,7 @@
- +
@@ -298,7 +308,7 @@
- +
@@ -308,11 +318,13 @@
- - - - + @foreach($services as $service) + + @endforeach @@ -340,6 +352,8 @@ @endsection @section('script') + + @endsection \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index a010d3e..812fb34 100644 --- a/routes/web.php +++ b/routes/web.php @@ -58,7 +58,7 @@ Route::get('/career', [HomeController::class, 'working_dice']); Route::post('/career', [HomeController::class, 'save_career'])->name('career'); Route::get('/service/{slug}', [FrontendServiceController::class,'single_service']); -Route::post('/contact_mail', [HomeController::class, 'send_contact_mail']); +Route::post('/contact_mail', [HomeController::class, 'send_contact_mail'])->name('send_contact_mail'); Route::post('/subscribe', [HomeController::class, 'subscribe']); Route::get('/ndis', function(){ return view('ndis');