title: Laravel Backpack custom validation over multiple attributes
body: <p><strong>How do I custom validate multiple attributes in a Laravel Backpack CRUD controller update?</strong></p>
  <p>Lets say I have a ZIP, CITY, DELIVERY_PICKUP and DELIVERY_SHIPPING.<br />
  And lets say my wanted rules are:</p>
  <ol>
  <li>one of DELIVERY_PICKUP and/or DELIVERY_SHIPPING has to be selected</li>
  <li>if DELIVERY_SHIPPING is chosen ZIP and CITY need to be filled</li>
  </ol>
  <p>Its possible to write custom validation rules with multiple attributes in laravel like this</p>
  <pre><code>namespace App\Rules;
  
  use Illuminate\Contracts\Validation\Rule;
  
  class Delivery implements Rule
  {
  
      public $delivery_shipping;
      public $delivery_pick_up;
      public $zip;
      public $city;
  
      public function __construct($delivery_shipping,$delivery_pick_up,$zip,$city)
      {
          $this-&gt;delivery_shipping = $delivery_shipping;
          $this-&gt;delivery_pick_up = $delivery_pick_up;
          $this-&gt;zip = $zip;
          $this-&gt;city = $city;
      }
  </code></pre>
  <p>But how do I fit it in Backpacks FormRequest and fill it with the values?</p>
  <pre><code>namespace App\Http\Requests;
  
  use App\Http\Requests\Request;
  use Illuminate\Foundation\Http\FormRequest;
  
  class AdvertRequest extends FormRequest
  {
  
      public function rules()
      {
          return [
              'title' =&gt; 'required|min:5|max:255',
              'frontend_user_id' =&gt; 'required',
              'profile_type' =&gt; 'required',
              'advertisement_type' =&gt; 'required',
              'marketplace_category_id' =&gt; 'required',
              'price' =&gt; 'numeric|nullable',
              'price_mode' =&gt; 'required',
              'content' =&gt; 'required',
              'zip' =&gt; 'required|numeric',
              'city' =&gt; 'required|min:1|max:255',
              'delivery_shipping' =&gt; 'Delivery',
          ];
      }
  </code></pre>