title: Getting data properly in Laravel with PHP after querying in database
body: <p>So I am trying to show text in a select of a form in HTML depending of the language of the user, I am using Laravel and I have a simple way to do it:</p>
  
  <pre><code>Lang::get('texts.whatever');
  </code></pre>
  
  <p>That goes to texts.php file that changes 'whatever' for a proper text.</p>
  
  <p>Besides, I have an associative array like this: <code>$dropdown = ['1'=&gt;'France','2'=&gt;'Germany', '3'=&gt;'Greece', '4'=&gt;'Portugal', '5'=&gt;'Spain', '6'=&gt;'United Kingdom'];</code></p>
  
  <p>And something like this:</p>
  
  <pre><code>@foreach($dropdown as $id=&gt;$name)           
  &lt;?php
      $newArray[$id]=Lang::get('texts.'.$name);
  ?&gt;
  @endforeach
  
  &lt;?php
      $dropdown = $newArray;
  ?&gt;
  </code></pre>
  
  <p>After that, I use $dropdown in my select of the form and it shows texts plus whatever it is in $name. It does not "get" the text in texts.php. However, if I change 'texts.'.$name to 'texts.yeah' (for example) it fills the select properly.</p>
  
  <p>I tried <code>eval()</code>, <code>exec()</code>, etc. and I don't know what else to do. Maybe I am not using them right.</p>
  
  <p>Any tips or advice? Thank you in advance.</p>