title: Cannot access Blade Component variables inside the view
body: <p>I have been running into this very weird issue with Laravel.</p>
  <p>I had a problem where one of my component views was not able to read the variables defined in its class.
  It was kind of strange because I have several components running in my project and they all worked fine, except for this one.</p>
  <p>So I created a fresh Laravel project to test some things out (Wanted to check if the problem was on my end, maybe I somehow messed up the project files).</p>
  <p>I created a new component on a blank project using <code>php artisan make:component Test</code></p>
  <p>Then I simply added a test variable to the class component like so:</p>
  <pre><code>&lt;?php
  
  namespace App\View\Components;
  
  use Illuminate\View\Component;
  
  class Test extends Component
  {
  
      public $test;
  
      /**
       * Create a new component instance.
       *
       * @return void
       */
      public function __construct()
      {
          $this-&gt;test = &quot;testing&quot;;
      }
  
      /**
       * Get the view / contents that represent the component.
       *
       * @return \Illuminate\View\View|string
       */
      public function render()
      {
          return view('components.test');
      }
  }
  </code></pre>
  <p>And tried to access it over in the view like so:</p>
  <pre><code>&lt;div&gt;
      &lt;p&gt; {{$test}} &lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  <p>For some reason, this is not working and I can't figure out why. It just says that <code>$test</code> is undefined.
  Perhaps I should point out, I am a beginner in Laravel, so excuse me if I am making some obvious mistake. It just seemed weird that this is not working on a blank project.</p>
  <p>Thank you in advance.</p>
  <p><a href="https://i.stack.imgur.com/gAXrt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gAXrt.png" alt="Error-Related Image" /></a></p>