title: Why is my variable displaying incorrect value in Laravel 5.4 Blade file?
body: <p>I have a variable <code>$country_code</code> that is displaying the correct value in one part of my form but not in a different part. Why is this happening?</p>
  
  <p>This is my code:</p>
  
  <pre><code>{{ Form::open(['action' =&gt; ['PinVerificationController@valid'],'id'=&gt;'pin_code_form']) }}
      //$country_code shows 1
      We sent a text message to {{$country_code}} {{$phone_number}}. You should receive it within a few seconds.&lt;br&gt;&lt;br&gt;
      {{ Form::label('Pin Code', null, ['class' =&gt; 'control-label']) }}
      {{ Form::hidden('country_code', $country_code) }}//&lt;------shows 1-US instead of 1
      {{ Form::hidden('phone_number', $phone_number) }}
      {{ Form::hidden('type', $pin_notification_type) }}
      {{ Form::text('pin_code', null,['placeholder' =&gt; 'Pin Code'])}}&lt;br&gt;&lt;br&gt;
      Enter a 4 digit pin you received by phone.
      &lt;br&gt;
      &lt;br&gt;
      {{ Form::submit('Verify',['name'=&gt;'validate'])}}
  
  {{ Form::close() }}
  </code></pre>
  
  <p>So if I set $country_code to "1" in my controller it'll display <strong>We sent a text message to 1 5555555. You should receive it within a few seconds.</strong>
  But if I do an inspect element on my hidden form it displays 1-US. I've tried <code>php artisan view:clear</code> and <code>php artisan clear-compiled</code> but the problem still persists.</p>
  
  <p>I've also tried hardcoding a value <code>{{ Form::hidden('country_code', 'asdf') }}</code> and i'm not seeing the change. I tried adding a test <code>{{ Form::hidden('country_code1', 'asdf') }}</code> and see the update.</p>
  
  <p>I also renamed <code>country_code</code> to <code>country_code111</code> for my hidden field and it displayed the correct value of 1. I thought it was a caching issue but like I mentioned I've tried <code>php artisan cache:clear</code> and the problem is still there.</p>