title: How to validate without request in Laravel
body: <p>I need to validate an array but without a request.
  In laravel docs validation is described like this:</p>
  
  <pre><code>$validator = Validator::make($request-&gt;all(), [
      'title' =&gt; 'required|unique:posts|max:255',
      'body' =&gt; 'required',
  ]);
  </code></pre>
  
  <p>But I can't use  $request because the data comes from an external api and the validation is not inside a controller. How can I validate this array? For example:</p>
  
  <pre><code>$validatedData = validate([
      'id' =&gt; 1,
      'body' =&gt; 'text'
  ], [
      'id' =&gt; 'required',
      'body' =&gt; 'required'
  ]);
  </code></pre>