title: How to concatenate string to a $variable in blade?
body: <p>I want to add a variable( in my case it is called <strong>$document</strong>) from my database to a URL asset directory in the view of my blade file to enable a user to view the image in the web browser. An example is as follows;</p>
  <pre><code>// MyController File
  
  // the variable $code is a parameter I'm accepting from the web.php route file for 
  // the function show() to help process the assignment value of $data['document'] without issues
  
  public function show($code)
      {
          //  NB: I am passing the document as an array list item of $data as below, so I can mention it as 
          //  a variable in the blade view file 
          //  $data['document']
  
          $data['document'] = Auth::user()-&gt;documents-&gt;where(&quot;code&quot;, $code)-&gt;first();
  
          return view(&quot;documents.show&quot;, $data);
      }
  
  
  
  // Blade View File
  
  &lt;div class=&quot;my-class&quot; style=&quot;background: url({{ URL::asset('assets/storage/' +$document-&gt;file_url) }}) no-repeat center top; background-size: cover;&quot;&gt;
  &lt;/div&gt; 
  </code></pre>