title: laravel 7 blade component public methods not working
body: <p>I have a problem with my Laravel project in using <a href="https://laravel.com/docs/7.x/blade#components" rel="nofollow noreferrer">blade component</a>.</p>
  <p>When I define a new component and want to use &quot;Component public Methods&quot; to pass data to &quot;view component blade file&quot;, I receive an error, &quot;Undefined variable&quot;</p>
  <p>The component has been made by</p>
  <pre><code>php artisan make:component testc 
  </code></pre>
  <p>and i try</p>
  <pre><code>cache:clear
  
  view:clear
  </code></pre>
  <p>and <code>composer dump</code> before</p>
  <p>and has following codes:</p>
  <p><strong>component code</strong></p>
  <pre><code>&lt;?php
  
  namespace App\View\Components;
  
  use Illuminate\View\Component;
  
  class testc extends Component
  {
      /**
       * Create a new component instance.
       *
       * @return void
       */
      public function __construct()
      {
          //
      }
  
      /**
       * Get the view / contents that represent the component.
       *
       * @return \Illuminate\View\View|string
       */
      public function render()
      {
          return view('components.testc');
      }
  
      public function test()
      {
          return 'test';
      }
  }
  </code></pre>
  <p><strong>view component blade file</strong></p>
  <pre><code>&lt;div&gt;
      {{ $test }}
  &lt;/div&gt;
  </code></pre>
  <p><strong>and my error</strong></p>
  <p><a href="https://i.stack.imgur.com/8xwym.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8xwym.png" alt="enter image description here" /></a></p>
  <p>ps: laravel version is : 7.18.0</p>