ソースを参照

Merge branch 'master' of https://rav.triplestart.com/Petermuturi/snyder

Peter Muturi 2 年 前
コミット
477c631f37

+ 11 - 7
.env.example

@@ -1,19 +1,19 @@
-APP_NAME=Laravel
+APP_NAME="Snyder Hemband"
 APP_ENV=local
 APP_KEY=
 APP_DEBUG=true
-APP_URL=http://localhost
+APP_URL=https://snyderhemband.org
 
 LOG_CHANNEL=stack
 LOG_DEPRECATIONS_CHANNEL=null
 LOG_LEVEL=debug
 
-DB_CONNECTION=mysql
+DB_CONNECTION=pgsql
 DB_HOST=127.0.0.1
-DB_PORT=3306
-DB_DATABASE=laravel
-DB_USERNAME=root
-DB_PASSWORD=
+DB_PORT=5432
+DB_DATABASE=hemband
+DB_USERNAME=postgres
+DB_PASSWORD=pass
 
 BROADCAST_DRIVER=log
 CACHE_DRIVER=file
@@ -50,3 +50,7 @@ PUSHER_APP_CLUSTER=mt1
 
 MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
 MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
+
+RECAPTCHA_SITE_KEY=6LcdDw8jAAAAAK53nmSD1kU_qr66Yes2XvnGEaSW
+RECAPTCHA_SECRET_KEY=6LcdDw8jAAAAAGf_hRQsoqwuXP46FuNkSektuobv
+RECAPTCHA_SITE=https://www.google.com/recaptcha/admin/

+ 4 - 2
app/Http/Controllers/AppController.php

@@ -46,7 +46,8 @@ class AppController extends Controller
         'name_last' => 'required|string',
         'email' => 'required|email',
         'phone' => 'required|string',
-        'zip' => 'required|string'
+        'zip' => 'required|string',
+        'g-recaptcha-response' => 'required|recaptcha'
       ]);
       
       $record = new PatientFindAClinicRequest;
@@ -70,7 +71,8 @@ class AppController extends Controller
         'phone' => '',
         'zip' => '',
         'subject' => '',
-        'message' => 'required|string'
+        'message' => 'required|string',
+        'g-recaptcha-response' => 'required|recaptcha'
       ]);
       
       $record = new PatientContactMessage;

+ 63 - 1
app/Http/Controllers/PhysiciansController.php

@@ -9,6 +9,8 @@ use Illuminate\Http\Request;
 
 use App\Models\PhysicianTrainingRequest;
 use App\Models\PhysicianContactMessage;
+use App\Models\PhysicianDirectoryListingRequest;
+use App\Models\PhysicianMarketingMaterialsRequest;
 
 class PhysiciansController extends Controller
 {
@@ -59,7 +61,7 @@ class PhysiciansController extends Controller
       return view('app.physicians.reimbursement-guide');
     }
 
-    public function submitPhysicianTrainingRequest(Request $request) {
+    public function submitTrainingRequest(Request $request) {
       $request->validate([
         'name_first' => 'required|string',
         'name_last' => 'required|string',
@@ -69,6 +71,7 @@ class PhysiciansController extends Controller
         'zip' => 'required|string',
         'training_type' => 'required|string',
         'training_format' => 'required|string',
+        'g-recaptcha-response' => 'required|recaptcha'
       ]);
 
       $record = new PhysicianTrainingRequest;
@@ -81,6 +84,7 @@ class PhysiciansController extends Controller
       $record->phone = $request->get('phone');
       $record->zip = $request->get('zip');
       $record->training_type = $request->get('training_type');
+      $record->training_type_other = $request->get('training_type_other');
       $record->training_format = $request->get('training_format');
       $record->notes = $request->get('notes');
 
@@ -116,4 +120,62 @@ class PhysiciansController extends Controller
       return redirect()->back()->with('success', 'Your request has been submitted!');
     }
 
+    public function submitPracticeSupportDirectoryListing(Request $request){
+      $request->validate([
+        'name_first' => 'required|string',
+        'name_last' => 'required|string',
+        'title' => 'required|string',
+        'practice_name' => 'required|string',
+        'email' => 'required|email',
+        'phone' => 'required|string',
+        'zip' => 'required|string',
+        'comment' => 'required|string',
+        'g-recaptcha-response' => 'required|recaptcha'
+      ]);
+
+      $record = new PhysicianDirectoryListingRequest;
+      $record->iid = $this->makeIID();
+      $record->uid = Uuid::uuid6();
+      $record->name_first = $request->get('name_first');
+      $record->name_last = $request->get('name_last');
+      $record->title = $request->get('title');
+      $record->practice_name = $request->get('practice_name');
+      $record->email = $request->get('email');
+      $record->phone = $request->get('phone');
+      $record->zip = $request->get('zip');
+      $record->comment = $request->get('comment');
+
+      $record->save();
+      return redirect()->back()->with('success', 'Your request has been submitted!');
+    }
+    public function submitOrderProductsMarketing(Request $request) {
+      $request->validate([
+        'name_first' => 'required|string',
+        'name_last' => 'required|string',
+        'title' => 'required|string',
+        'practice_name' => 'required|string',
+        'practice_address' => 'required|string',
+        'email' => 'required|email',
+        'phone' => 'required|string',
+        'zip' => 'required|string',
+        'comment' => 'required|string',
+        'g-recaptcha-response' => 'required|recaptcha'
+      ]);
+
+      $record = new PhysicianMarketingMaterialsRequest;
+      $record->iid = $this->makeIID();
+      $record->uid = Uuid::uuid6();
+      $record->name_first = $request->get('name_first');
+      $record->name_last = $request->get('name_last');
+      $record->title = $request->get('title');
+      $record->practice_name = $request->get('practice_name');
+      $record->practice_address = $request->get('practice_address');
+      $record->email = $request->get('email');
+      $record->phone = $request->get('phone');
+      $record->zip = $request->get('zip');
+      $record->comment = $request->get('comment');
+
+      $record->save();
+      return redirect()->back()->with('success', 'Your request has been submitted!');
+    }
 }

+ 11 - 0
app/Models/PhysicianDirectoryListingRequest.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace App\Models;
+
+use App\Models\Base\BaseModel;
+use Illuminate\Database\Eloquent\Model;
+
+class PhysicianDirectoryListingRequest extends BaseModel
+{
+    protected $table = 'physician_directory_listing_request';
+}

+ 11 - 0
app/Models/PhysicianMarketingMaterialsRequest.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace App\Models;
+
+use App\Models\Base\BaseModel;
+use Illuminate\Database\Eloquent\Model;
+
+class PhysicianMarketingMaterialsRequest extends BaseModel
+{
+    protected $table = 'physician_marketing_materials_request';
+}

+ 1 - 0
composer.json

@@ -6,6 +6,7 @@
     "license": "MIT",
     "require": {
         "php": "^7.3|^8.0",
+        "biscolab/laravel-recaptcha": "^5.4",
         "fruitcake/laravel-cors": "^2.0",
         "guzzlehttp/guzzle": "^7.0.1",
         "laravel/framework": "^8.75",

+ 73 - 2
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "c61ff82cbf0142a401a48a8161e1595a",
+    "content-hash": "d994c8882a79491311ca56c8b9d912d4",
     "packages": [
         {
             "name": "asm89/stack-cors",
@@ -62,6 +62,77 @@
             },
             "time": "2022-01-18T09:12:03+00:00"
         },
+        {
+            "name": "biscolab/laravel-recaptcha",
+            "version": "v5.4.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/biscolab/laravel-recaptcha.git",
+                "reference": "1bab726402d5376553a439b88a0faa07e84488fd"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/biscolab/laravel-recaptcha/zipball/1bab726402d5376553a439b88a0faa07e84488fd",
+                "reference": "1bab726402d5376553a439b88a0faa07e84488fd",
+                "shasum": ""
+            },
+            "require": {
+                "illuminate/routing": "^7.0|^8.0|^9.0",
+                "illuminate/support": "^7.0|^8.0|^9.0",
+                "php": "^7.3|^8.0"
+            },
+            "require-dev": {
+                "orchestra/testbench": "5.*|6.*|^7.0",
+                "phpunit/phpunit": "^9.1"
+            },
+            "suggest": {
+                "biscolab/laravel-authlog": "It allows to handle logged-in users and force log-out if needed"
+            },
+            "type": "library",
+            "extra": {
+                "laravel": {
+                    "providers": [
+                        "Biscolab\\ReCaptcha\\ReCaptchaServiceProvider"
+                    ],
+                    "aliases": {
+                        "ReCaptcha": "Biscolab\\ReCaptcha\\Facades\\ReCaptcha"
+                    }
+                }
+            },
+            "autoload": {
+                "files": [
+                    "src/helpers.php"
+                ],
+                "psr-4": {
+                    "Biscolab\\ReCaptcha\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Roberto Belotti",
+                    "email": "roby.belotti@gmail.com",
+                    "homepage": "https://biscolab.com",
+                    "role": "Developer"
+                }
+            ],
+            "description": "Simple and painless Google reCAPTCHA package for Laravel framework",
+            "homepage": "https://biscolab.com/laravel-recaptcha",
+            "keywords": [
+                "captcha",
+                "laravel",
+                "recaptcha",
+                "validation"
+            ],
+            "support": {
+                "issues": "https://github.com/biscolab/laravel-recaptcha/issues",
+                "source": "https://github.com/biscolab/laravel-recaptcha/tree/v5.4.0"
+            },
+            "time": "2022-05-07T12:52:46+00:00"
+        },
         {
             "name": "brick/math",
             "version": "0.9.3",
@@ -7706,5 +7777,5 @@
         "php": "^7.3|^8.0"
     },
     "platform-dev": [],
-    "plugin-api-version": "2.0.0"
+    "plugin-api-version": "2.3.0"
 }

+ 3 - 0
config/app.php

@@ -15,6 +15,9 @@ return [
 
     'name' => env('APP_NAME', 'Laravel'),
 
+    'recaptchaSiteKey' => env('RECAPTCHA_SITE_KEY', ''),
+    'recaptchaSecretKey' => env('RECAPTCHA_SECRET_KEY', ''),
+
     /*
     |--------------------------------------------------------------------------
     | Application Environment

+ 179 - 0
config/recaptcha.php

@@ -0,0 +1,179 @@
+<?php
+
+/**
+ * Copyright (c) 2017 - present
+ * LaravelGoogleRecaptcha - recaptcha.php
+ * author: Roberto Belotti - roby.belotti@gmail.com
+ * web : robertobelotti.com, github.com/biscolab
+ * Initial version created on: 12/9/2018
+ * MIT license: https://github.com/biscolab/laravel-recaptcha/blob/master/LICENSE
+ */
+
+/**
+ * To configure correctly please visit https://developers.google.com/recaptcha/docs/start
+ */
+return [
+
+    /**
+     *
+     * The site key
+     * get site key @ www.google.com/recaptcha/admin
+     *
+     */
+    'api_site_key'                 => env('RECAPTCHA_SITE_KEY', ''),
+
+    /**
+     *
+     * The secret key
+     * get secret key @ www.google.com/recaptcha/admin
+     *
+     */
+    'api_secret_key'               => env('RECAPTCHA_SECRET_KEY', ''),
+
+    /**
+     *
+     * ReCATCHA version
+     * Supported: "v2", "invisible", "v3",
+     *
+     * get more info @ https://developers.google.com/recaptcha/docs/versions
+     *
+     */
+    'version'                      => 'v2',
+
+    /**
+     *
+     * The curl timout in seconds to validate a recaptcha token
+     * @since v3.5.0
+     *
+     */
+    'curl_timeout'                 => 10,
+
+    /**
+     *
+     * IP addresses for which validation will be skipped
+     * IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed
+     *
+     */
+    'skip_ip'                      => env('RECAPTCHA_SKIP_IP', []),
+
+    /**
+     *
+     * Default route called to check the Google reCAPTCHA token
+     * @since v3.2.0
+     *
+     */
+    'default_validation_route'     => 'biscolab-recaptcha/validate',
+
+    /**
+     *
+     * The name of the parameter used to send Google reCAPTCHA token to verify route
+     * @since v3.2.0
+     *
+     */
+    'default_token_parameter_name' => 'token',
+
+    /**
+     *
+     * The default Google reCAPTCHA language code
+     * It has no effect with v3
+     * @see   https://developers.google.com/recaptcha/docs/language
+     * @since v3.6.0
+     *
+     */
+    'default_language'             => null,
+
+    /**
+     *
+     * The default form ID. Only for "invisible" reCAPTCHA
+     * @since v4.0.0
+     *
+     */
+    'default_form_id'              => 'biscolab-recaptcha-invisible-form',
+
+    /**
+     *
+     * Deferring the render can be achieved by specifying your onload callback function and adding parameters to the JavaScript resource.
+     * It has no effect with v3 and invisible
+     * @see   https://developers.google.com/recaptcha/docs/display#explicit_render
+     * @since v4.0.0
+     * Supported true, false
+     *
+     */
+    'explicit'                     => false,
+
+    /**
+     *
+     * Set API domain. You can use "www.recaptcha.net" in case "www.google.com" is not accessible.
+     * (no check will be made on the entered value)
+     * @see   https://developers.google.com/recaptcha/docs/faq#can-i-use-recaptcha-globally
+     * @since v4.3.0
+     * Default 'www.google.com' (ReCaptchaBuilder::DEFAULT_RECAPTCHA_API_DOMAIN)
+     *
+     */
+    'api_domain'                   => 'www.google.com',
+
+    /**
+     *
+     * Set `true` when the error message must be null
+     * @since v5.1.0
+     * Default false
+     *
+     */
+    'empty_message' => false,
+
+    /**
+     *
+     * Set either the error message or the errom message translation key
+     * @since v5.1.0
+     * Default 'validation.recaptcha'
+     *
+     */
+    'error_message_key' => 'validation.recaptcha',
+
+    /**
+     *
+     * g-recaptcha tag attributes and grecaptcha.render parameters (v2 only)
+     * @see   https://developers.google.com/recaptcha/docs/display#render_param
+     * @since v4.0.0
+     */
+    'tag_attributes'               => [
+
+        /**
+         * The color theme of the widget.
+         * Supported "light", "dark"
+         */
+        'theme'            => 'light',
+
+        /**
+         * The size of the widget.
+         * Supported "normal", "compact"
+         */
+        'size'             => 'normal',
+
+        /**
+         * The tabindex of the widget and challenge.
+         * If other elements in your page use tabindex, it should be set to make user navigation easier.
+         */
+        'tabindex'         => 0,
+
+        /**
+         * The name of your callback function, executed when the user submits a successful response.
+         * The g-recaptcha-response token is passed to your callback.
+         * DO NOT SET "biscolabOnloadCallback"
+         */
+        'callback'         => null,
+
+        /**
+         * The name of your callback function, executed when the reCAPTCHA response expires and the user needs to re-verify.
+         * DO NOT SET "biscolabOnloadCallback"
+         */
+        'expired-callback' => null,
+
+        /**
+         * The name of your callback function, executed when reCAPTCHA encounters an error (usually network connectivity) and cannot continue until connectivity is restored.
+         * If you specify a function here, you are responsible for informing the user that they should retry.
+         * DO NOT SET "biscolabOnloadCallback"
+         */
+        'error-callback'   => null,
+    ]
+];

+ 41 - 0
database/migrations/2022_11_16_083709_create_physician_directory_listing_request_table.php

@@ -0,0 +1,41 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePhysicianDirectoryListingRequestTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('physician_directory_listing_request', function (Blueprint $table) {
+            $table->id();
+            $table->string('uid')->unique();
+            $table->string('iid')->unique();
+            $table->string('name_first');
+            $table->string('name_last');
+            $table->string('title')->nullable();
+            $table->string('practice_name')->nullable();
+            $table->string('email')->nullable();
+            $table->string('phone')->nullable();
+            $table->string('zip')->nullable();
+            $table->text('comment')->nullable();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('physician_directory_listing_request');
+    }
+}

+ 42 - 0
database/migrations/2022_11_16_095025_create_physician_marketing_materials_request_table.php

@@ -0,0 +1,42 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePhysicianMarketingMaterialsRequestTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('physician_marketing_materials_request', function (Blueprint $table) {
+            $table->id();
+            $table->string('uid')->unique();
+            $table->string('iid')->unique();
+            $table->string('name_first');
+            $table->string('name_last');
+            $table->string('title')->nullable();
+            $table->string('practice_name')->nullable();
+            $table->string('practice_address')->nullable();
+            $table->string('email')->nullable();
+            $table->string('phone')->nullable();
+            $table->string('zip')->nullable();
+            $table->text('comment')->nullable();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('physician_marketing_materials_request');
+    }
+}

+ 7 - 1
resources/views/app/contact.blade.php

@@ -51,7 +51,7 @@
               @enderror
           </div>
           <div class="col-lg-6 form-group mb-4">
-            <input type="text" class="form-control rounded-0 py-3" name="phone" placeholder="Phone Number" value="{{ old('phone') }}">
+            <input type="text" class="form-control rounded-0 py-3 phone" name="phone" placeholder="Phone Number" value="{{ old('phone') }}">
             @error('phone')
                 <small class="text-warning">{{$message}}</small>
               @enderror
@@ -76,6 +76,12 @@
               <small class="text-warning">{{$message}}</small>
             @enderror
         </div>
+        <div class="form-group mb-4">
+            {!! htmlFormSnippet() !!}
+            @error('g-recaptcha-response')
+              <small class="text-danger"><i class="fas fa-exclamation-triangle mr-2"></i>Invalid</small>
+            @enderror
+          </div>
         <button type="submit" class="btn btn-pry w-100 py-3">Submit message</button>
       </form>
     </div>

+ 17 - 9
resources/views/app/find-a-clinic.blade.php

@@ -51,6 +51,18 @@
       <form class="" action="{{ route('submit-find-a-clinic') }}" method="post">
         @csrf
         <div class="row">
+          <div class="col-12">
+            @if($errors->any())
+            <div class="alert alert-danger fade show" role="alert">
+                There were errors found!
+            </div>
+            @endif
+            @if(session('success'))
+            <div class="alert alert-success fade show" role="alert">
+                {{session('success')}}
+            </div>
+            @endif
+          </div>
           <div class="col-lg-6 form-group mb-4">
             <input type="text" class="form-control rounded-0 py-3" name="name_first" placeholder="First Name" value="{{ old('name_first') }}" />
             @error('name_first')
@@ -82,16 +94,12 @@
               <small class="text-warning">{{$message}}</small>
             @enderror
         </div>
-        @if($errors->any())
-        <div class="alert alert-danger fade show" role="alert">
-            There were errors found!
-        </div>
-        @endif
-        @if(session('success'))
-        <div class="alert alert-success fade show" role="alert">
-            {{session('success')}}
+        <div class="form-group mb-4">
+          {!! htmlFormSnippet() !!}
+          @error('g-recaptcha-response')
+            <small class="text-danger"><i class="fas fa-exclamation-triangle mr-2"></i>Invalid</small>
+          @enderror
         </div>
-        @endif
         <button type="submit" class="btn btn-pry w-100 py-3">Submit</button>
       </form>
     </div>

+ 7 - 1
resources/views/app/physicians/contact-us.blade.php

@@ -88,7 +88,7 @@
           </div>
           <div class="form-group mb-4">
             <label>Phone <span class="text-danger">*</span> </label>
-            <input type="tel" class="form-control rounded-0 py-3" required phone name="phone" value="{{ old('phone') }}">
+            <input type="tel" class="form-control rounded-0 py-3 phone" required phone placeholder="(xxx) xxx-xxxx" name="phone" value="{{ old('phone') }}">
             @error('phone')
                 <small class="text-warning">{{$message}}</small>
               @enderror
@@ -107,6 +107,12 @@
                 <small class="text-warning">{{$message}}</small>
               @enderror
           </div>
+          <div class="form-group mb-4">
+            {!! htmlFormSnippet() !!}
+            @error('g-recaptcha-response')
+              <small class="text-danger"><i class="fas fa-exclamation-triangle mr-2"></i>Invalid</small>
+            @enderror
+          </div>
           <button type="submit" class="btn btn-pry w-100 py-3">SUBMIT</button>
         </form>
       </div>

+ 49 - 22
resources/views/app/physicians/get-trained.blade.php

@@ -50,20 +50,32 @@
       <form class="" action="{{ route('physicians.submit-training-request') }}" method="post">
         @csrf
         <div class="row">
+          <div class="col-12">
+            @if($errors->any())
+              <div class="alert alert-danger fade show" role="alert">
+                There were errors found!
+              </div>
+            @endif
+            @if(session('success'))
+              <div class="alert alert-success fade show" role="alert">
+                {{session('success')}}
+              </div>
+            @endif
+          </div>
           <div class="col-lg-6 form-group mb-4">
-            <input type="text" class="form-control rounded-0 py-3" name="name_first" placeholder="First Name" value="{{ old('name_first') }}" />
+            <input type="text" class="form-control rounded-0 py-3" name="name_first" placeholder="First Name" value="{{ old('name_first') }}" required />
             @error('name_first')
             <small class="text-warning">{{$message}}</small>
             @enderror
           </div>
           <div class="col-lg-6 form-group mb-4">
-            <input type="text" class="form-control rounded-0 py-3" name="name_last" placeholder="Last Name" value="{{ old('name_last') }}" />
+            <input type="text" class="form-control rounded-0 py-3" name="name_last" placeholder="Last Name" value="{{ old('name_last') }}" required />
             @error('name_last')
             <small class="text-warning">{{$message}}</small>
             @enderror
           </div>
           <div class="col-lg-12 form-group mb-4">
-            <input type="text" class="form-control rounded-0 py-3" name="practice_name" placeholder="Practice Name" value="{{ old('practice_name') }}" />
+            <input type="text" class="form-control rounded-0 py-3" name="practice_name" placeholder="Practice Name" value="{{ old('practice_name') }}" required />
             @error('practice_name')
             <small class="text-warning">{{$message}}</small>
             @enderror
@@ -71,13 +83,13 @@
         </div>
         <div class="row">
           <div class="col-lg-6 form-group mb-4">
-            <input type="email" class="form-control rounded-0 py-3" name="email" placeholder="Contact Email" value="{{ old('email') }}" />
+            <input type="email" class="form-control rounded-0 py-3" name="email" placeholder="Contact Email" value="{{ old('email') }}" required />
             @error('email')
             <small class="text-warning">{{$message}}</small>
             @enderror
           </div>
           <div class="col-lg-6 form-group mb-4">
-            <input type="text" class="form-control rounded-0 py-3" name="phone" placeholder="Contact Phone Number" value="{{ old('phone') }}" />
+            <input type="text" class="form-control rounded-0 py-3" name="phone" placeholder="Contact Phone Number" value="{{ old('phone') }}" required />
             @error('phone')
             <small class="text-warning">{{$message}}</small>
             @enderror
@@ -85,25 +97,31 @@
         </div>
         
         <div class="form-group mb-4">
-          <input type="text" class="form-control rounded-0 py-3" name="zip" placeholder="Zip Code" value="{{ old('zip') }}" />
+          <input type="text" class="form-control rounded-0 py-3" name="zip" placeholder="Zip Code" value="{{ old('zip') }}" required />
           @error('zip')
           <small class="text-warning">{{$message}}</small>
           @enderror
         </div>
         <div class="row">
           <div class="col-lg-6 form-group mb-4">
-            <select class="form-control rounded-0 py-3" name="training_type">
+            <select class="form-control rounded-0 py-3" name="training_type" onchange="return showField(this, 'other')">
               <option value="">Training Type</option>
-              <option value="Clinical Training">Clinical Training</option>
-              <option value="Staff Training">Staff Training</option>
-              <option value="Other">Other</option>
+              <option value="clinical">Clinical Training</option>
+              <option value="staff">Staff Training</option>
+              <option value="other">Other</option>
             </select>
             @error('training_type')
             <small class="text-warning">{{$message}}</small>
             @enderror
           </div>
+          <div class="col-lg-6 form-group mb-4 training_type d-none">
+            <input type="text" class="form-control rounded-0 py-3" placeholder="Other training type" name="training_type_other" value="{{ old('training_type_other') }}">
+            @error('training_type_other')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
+          </div>
           <div class="col-lg-6 form-group mb-4">
-          <select class="form-control rounded-0 py-3" name="training_format">
+          <select class="form-control rounded-0 py-3" name="training_format" required>
               <option value="">Training Format</option>
               <option value="In-person">In-person</option>
               <option value="Online">Online</option>
@@ -120,20 +138,29 @@
               <small class="text-warning">{{$message}}</small>
             @enderror
         </div>
-
-        @if($errors->any())
-        <div class="alert alert-danger fade show" role="alert">
-          There were errors found!
-        </div>
-        @endif
-        @if(session('success'))
-        <div class="alert alert-success fade show" role="alert">
-          {{session('success')}}
-        </div>
-        @endif
+        <div class="form-group mb-4">
+            {!! htmlFormSnippet() !!}
+            @error('g-recaptcha-response')
+              <small class="text-danger"><i class="fas fa-exclamation-triangle mr-2"></i>Invalid</small>
+            @enderror
+          </div>
         <button type="submit" class="btn btn-pry w-100 py-3">Submit</button>
       </form>
     </div>
   </div>
 </div>
+
+<script type="text/javascript">
+  function showField(_elem, _trigger) {
+    var name = _elem.name;
+    var val = $(_elem).val();
+    if (val == _trigger) {
+      $('.'+name).removeClass('d-none')
+    }else {
+      $('.'+name).addClass('d-none');
+    }
+  }
+</script>
+
+
 @endsection

+ 49 - 4
resources/views/app/physicians/order-products/marketing.blade.php

@@ -34,49 +34,94 @@
       <p class="mt-4">We know that marketing materials are a huge asset in helping patients and staff understand the Snyder HemBand procedure. Because of this, we’re happy to provide a variety of marketing materials at no cost to you or your practice.</p>
       <p>To place an order, please fill out the form below or submit an order form via fax or email <a href="mailto:info@snyderhemband.org">info@snyderhemband.org</a>.</p>
       <div class="bg-light p-4">
-        <form class="" action="" method="post">
+        <form class="" action="{{ route('physicians.submit-order-products-marketing') }}" method="post">
           @csrf
           <div class="row">
+            <div class="col-12">
+              @if($errors->any())
+                <div class="alert alert-danger fade show" role="alert">
+                  There were errors found!
+                </div>
+              @endif
+              @if(session('success'))
+                <div class="alert alert-success fade show" role="alert">
+                  {{session('success')}}
+                </div>
+              @endif
+            </div>
             <div class="col-lg-6 form-group mb-4">
               <label>First Name <span class="text-danger">*</span> </label>
               <input type="text" class="form-control rounded-0 py-3" required name="name_first" value="{{ old('name_first') }}">
+              @error('name_first')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
             </div>
             <div class="col-lg-6 form-group mb-4">
               <label>Last Name <span class="text-danger">*</span> </label>
               <input type="text" class="form-control rounded-0 py-3" required name="name_last" value="{{ old('name_last') }}">
+              @error('name_last')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
             </div>
           </div>
           <div class="form-group mb-4">
             <label>Title <span class="text-danger">*</span> </label>
             <input type="text" class="form-control rounded-0 py-3" required name="title" value="{{ old('title') }}">
+            @error('title')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
           </div>
           <div class="row">
             <div class="col-lg-4 form-group mb-4">
               <label>Practice Name <span class="text-danger">*</span> </label>
               <input type="text" class="form-control rounded-0 py-3" required name="practice_name" value="{{ old('practice_name') }}">
+              @error('practice_name')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
             </div>
             <div class="col-lg-5 form-group mb-4">
               <label>Practice Address <span class="text-danger">*</span> </label>
               <input type="text" class="form-control rounded-0 py-3" required name="practice_address" value="{{ old('practice_address') }}">
+              @error('practice_address')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
             </div>
             <div class="col-lg-3 form-group mb-4">
               <label>Practice Zip Code <span class="text-danger">*</span> </label>
-              <input type="text" class="form-control rounded-0 py-3" required name="practice_zip" value="{{ old('practice_zip') }}">
+              <input type="text" class="form-control rounded-0 py-3" required name="zip" value="{{ old('zip') }}">
+              @error('zip')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
             </div>
           </div>
           <div class="row">
             <div class="col-lg-6 form-group mb-4">
               <label>Contact Phone Number <span class="text-danger">*</span> </label>
-              <input type="tel" class="form-control rounded-0 py-3 phone" required placeholder="(xxx) xxx-xxxx" name="contact_phone" value="{{ old('contact_phone') }}">
+              <input type="tel" class="form-control rounded-0 py-3 phone" required placeholder="(xxx) xxx-xxxx" name="phone" value="{{ old('phone') }}">
+              @error('phone')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
             </div>
             <div class="col-lg-6 form-group mb-4">
               <label>Contact Email <span class="text-danger">*</span> </label>
               <input type="email" class="form-control rounded-0 py-3" required name="email" value="{{ old('email') }}">
+              @error('email')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
             </div>
           </div>
           <div class="form-group mb-4">
             <label>Order request</label>
-            <textarea name="request" class="form-control rounded-0" rows="6">{{ old('request') }}</textarea>
+            <textarea name="comment" class="form-control rounded-0" rows="6">{{ old('comment') }}</textarea>
+              @error('comment')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
+          </div>
+          <div class="form-group mb-4">
+            {!! htmlFormSnippet() !!}
+            @error('g-recaptcha-response')
+              <small class="text-danger"><i class="fas fa-exclamation-triangle mr-2"></i>Invalid</small>
+            @enderror
           </div>
           <button type="submit" class="btn btn-pry w-100 py-3">SUBMIT</button>
         </form>

+ 47 - 4
resources/views/app/physicians/practice-support/directory-listing.blade.php

@@ -28,43 +28,86 @@
     <div class="row justify-content-center">
       <div class="col-lg-8">
         <h5 class="header mb-4">Complete the form below</h5>
-        <form class="" action="" method="post">
+        <form class="" action="{{ route('physicians.submit-practice-support-directory-listing-request') }}" method="post">
           @csrf
           <div class="row">
+            <div class="col-12">
+              @if(session('success'))
+                <div class="alert alert-success fade show" role="alert">
+                    {{session('success')}}
+                </div>
+              @endif
+
+              @if($errors->any())
+              <div class="alert alert-danger fade show" role="alert">
+                  There were errors found!
+              </div>
+              @endif
+            </div>
             <div class="col-lg-6 form-group mb-4">
               <label>First Name <span class="text-danger">*</span> </label>
               <input type="text" class="form-control rounded-0 py-3" required name="name_first" value="{{ old('name_first') }}">
+              @error('name_first')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
             </div>
             <div class="col-lg-6 form-group mb-4">
               <label>Last Name <span class="text-danger">*</span> </label>
               <input type="text" class="form-control rounded-0 py-3" required name="name_last" value="{{ old('name_last') }}">
+              @error('name_last')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
             </div>
           </div>
           <div class="form-group mb-4">
             <label>Title <span class="text-danger">*</span> </label>
             <input type="text" class="form-control rounded-0 py-3" required name="title" value="{{ old('title') }}">
+            @error('title')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
           </div>
           <div class="row">
             <div class="col-lg-5 form-group mb-4">
               <label>Practice Name <span class="text-danger">*</span> </label>
               <input type="text" class="form-control rounded-0 py-3" required name="practice_name" value="{{ old('practice_name') }}">
+              @error('practice_name')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
             </div>
             <div class="col-lg-3 form-group mb-4">
               <label>Practice Zip Code <span class="text-danger">*</span> </label>
-              <input type="text" class="form-control rounded-0 py-3" required name="practice_zip" value="{{ old('practice_zip') }}">
+              <input type="text" class="form-control rounded-0 py-3" required name="zip" value="{{ old('zip') }}">
+              @error('zip')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
             </div>
             <div class="col-lg-4 form-group mb-4">
               <label>Practice Phone Number <span class="text-danger">*</span> </label>
-              <input type="tel" class="form-control rounded-0 py-3 phone" required placeholder="(xxx) xxx-xxxx" name="practice_phone" value="{{ old('practice_phone') }}">
+              <input type="tel" class="form-control rounded-0 py-3 phone" required placeholder="(xxx) xxx-xxxx" name="phone" value="{{ old('phone') }}">
+              @error('phone')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
             </div>
           </div>
           <div class="form-group mb-4">
             <label>Contact Email <span class="text-danger">*</span> </label>
             <input type="email" class="form-control rounded-0 py-3" required name="email" value="{{ old('email') }}">
+            @error('email')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
           </div>
           <div class="form-group mb-4">
             <label>Other comments</label>
-            <textarea name="message" class="form-control rounded-0" rows="6">{{ old('message') }}</textarea>
+            <textarea name="comment" class="form-control rounded-0" rows="6">{{ old('comment') }}</textarea>
+            @error('comment')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
+          </div>
+          <div class="form-group mb-4">
+            {!! htmlFormSnippet() !!}
+            @error('g-recaptcha-response')
+              <small class="text-danger"><i class="fas fa-exclamation-triangle mr-2"></i>Invalid</small>
+            @enderror
           </div>
           <button type="submit" class="btn btn-pry w-100 py-3">SUBMIT</button>
         </form>

+ 53 - 6
resources/views/app/physicians/practice-support/training.blade.php

@@ -32,35 +32,65 @@
     <div class="row justify-content-center">
       <div class="col-lg-8">
         <h5 class="header mb-4">Schedule a Session</h5>
-        <form class="" action="" method="post">
+        <form class="" action="{{ route('physicians.submit-training-request') }}" method="post">
           @csrf
           <div class="row">
+            <div class="col-12">
+              @if($errors->any())
+                <div class="alert alert-danger fade show" role="alert">
+                  There were errors found!
+                </div>
+              @endif
+              @if(session('success'))
+                <div class="alert alert-success fade show" role="alert">
+                  {{session('success')}}
+                </div>
+              @endif
+            </div>
             <div class="col-lg-4 form-group mb-4">
               <label>First Name <span class="text-danger">*</span> </label>
               <input type="text" class="form-control rounded-0 py-3" required name="name_first" value="{{ old('name_first') }}">
+              @error('name_first')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
             </div>
             <div class="col-lg-4 form-group mb-4">
               <label>Last Name <span class="text-danger">*</span> </label>
               <input type="text" class="form-control rounded-0 py-3" required name="name_last" value="{{ old('name_last') }}">
+              @error('name_last')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
             </div>
             <div class="col-lg-4 form-group mb-4">
               <label>Practice Name <span class="text-danger">*</span> </label>
               <input type="text" class="form-control rounded-0 py-3" required name="practice_name" value="{{ old('practice_name') }}">
+              @error('practice_name')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
             </div>
           </div>
           <div class="row">
             <div class="col-lg-6 form-group mb-4">
               <label>Contact Email <span class="text-danger">*</span> </label>
               <input type="email" class="form-control rounded-0 py-3" required name="email" value="{{ old('email') }}">
+              @error('email')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
             </div>
             <div class="col-lg-6 form-group mb-4">
               <label>Contact Phone Number <span class="text-danger">*</span> </label>
               <input type="tel" class="form-control rounded-0 py-3 phone" required name="phone" placeholder="(xxx) xxx-xxxx" value="{{ old('phone') }}">
+              @error('phone')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
             </div>
           </div>
           <div class="form-group mb-4">
             <label>Zip Code <span class="text-danger">*</span> </label>
             <input type="text" class="form-control rounded-0 py-3" required name="zip" value="{{ old('zip') }}">
+            @error('zip')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
           </div>
           <div class="form-group mb-4">
             <label>Training Type <span class="text-danger">*</span> </label>
@@ -70,23 +100,40 @@
               <option value="staff">Staff Training</option>
               <option value="other">Other</option>
             </select>
+            @error('training_type')
+              <small class="text-warning">{{$message}}</small>
+            @enderror
           </div>
           <div class="form-group mb-4 training_type d-none">
             <label>Other <span class="text-danger">*</span> </label>
-            <input type="text" class="form-control rounded-0 py-3" required name="training_type_other" value="{{ old('training_type_other') }}">
+            <input type="text" class="form-control rounded-0 py-3" name="training_type_other" value="{{ old('training_type_other') }}">
+            @error('training_type_other')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
           </div>
           <div class="form-group mb-4">
             <label>Training Format <span class="text-danger">*</span> </label>
-            <select class="form-control rounded-0 py-3" required name="training_type">
+            <select class="form-control rounded-0 py-3" required name="training_format">
               <option value="">Select</option>
-              <option value="clinical">Clinical Training</option>
-              <option value="staff">Staff Training</option>
-              <option value="other">Other</option>
+              <option value="In-person">In-person</option>
+              <option value="Online">Online</option>
             </select>
+            @error('training_format')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
           </div>
           <div class="form-group mb-4">
             <label>Other notes</label>
             <textarea name="message" class="form-control rounded-0" rows="6">{{ old('message') }}</textarea>
+            @error('message')
+                <small class="text-warning">{{$message}}</small>
+              @enderror
+          </div>
+          <div class="form-group mb-4">
+            {!! htmlFormSnippet() !!}
+            @error('g-recaptcha-response')
+              <small class="text-danger"><i class="fas fa-exclamation-triangle mr-2"></i>Invalid</small>
+            @enderror
           </div>
           <button type="submit" class="btn btn-pry w-100 py-3">SUBMIT</button>
         </form>

+ 1 - 0
resources/views/layouts/base.blade.php

@@ -19,6 +19,7 @@
         $('.phone').mask('(000) 000-0000');
       })
     </script>
+    {!! ReCaptcha::htmlScriptTagJsApi() !!}
 </head>
 
 <body>

+ 2 - 0
routes/web.php

@@ -33,9 +33,11 @@ Route::prefix('/physicians/')->name('physicians.')->group(function () {
     Route::get('/practice-support/training', [PhysiciansController::class, 'practiceSupportTraining'])->name('practice-support-training');
     Route::get('/practice-support/reimbursement-guide', [PhysiciansController::class, 'practiceSupportReimbursement'])->name('practice-support-reimbursement');
     Route::get('/practice-support/directory-listing', [PhysiciansController::class, 'practiceSupportDirectoryListing'])->name('practice-support-directory');
+    Route::post('/practice-support/submit-directory-listing', [PhysiciansController::class, 'submitPracticeSupportDirectoryListing'])->name('submit-practice-support-directory-listing-request');
     Route::get('/order-products', [PhysiciansController::class, 'orderProducts'])->name('order-products');
     Route::get('/order-products/ligators', [PhysiciansController::class, 'orderProductsLigators'])->name('order-products-ligators');
     Route::get('/order-products/marketing-materials', [PhysiciansController::class, 'orderProductsMarketing'])->name('order-products-marketing');
+    Route::post('/order-products/submit-marketing-materials-request', [PhysiciansController::class, 'submitOrderProductsMarketing'])->name('submit-order-products-marketing');
     Route::get('/order-products/obp', [PhysiciansController::class, 'orderProductsObp'])->name('order-products-obp');
     Route::get('/fda-registration', [PhysiciansController::class, 'fdaRegistration'])->name('fda-registration');
     Route::get('/contact-us', [PhysiciansController::class, 'contactUs'])->name('contact-us');