title: Laravel problem store variables data in Database
body: <p>In my database name <code>files</code> have columns <code>id_message</code> and <code>file_path</code>. File is stored in <code>MyFiles/{id_message}</code>.</p>
  <p>Problem is how variables <code>$idParameter</code> and <code>$pathFile</code> save in database. No errors show.</p>
  <pre><code>    function fileUpload(Request $request)
      {
  
      $request-&gt;validate([
          'id_message' =&gt; 'required|min:6'
      ]);
     
      $idParameter = $request-&gt;id_message=$request-&gt;id_message;
  
      $result=$request-&gt;file('file_path')-&gt;store('MyFiles/'.$idParameter);
      return [&quot;result&quot;=&gt;$result];
      
      $pathFile = getPathname('MyFiles/'.$idParameter);
  
      $file = new File;
      $file-&gt;id_message=$idParameter;
      $file-&gt;file_path=$pathFile;
      $file-&gt;save();
      
  }
  </code></pre>