title: Slug problems show with laravel
body: <p>I have model:</p>
  <pre><code>class Header extends Model
  {
      use HasFactory;
      public function getRouteKeyName()
      {
          return 'slug';
      }
      
  }
  </code></pre>
  <p>my controller:</p>
  <pre><code>public function show($id)
  {
      $headers = DB::table('headers')-&gt;find($id);
      $blocks = DB::table('blocks')-&gt;where('header_id', $id)-&gt;get();
      return view('test', compact('headers', 'blocks'));
  }   
  </code></pre>
  <p>my route:</p>
  <pre><code>Route::get('/{id}', [MainController::class, 'show'])-&gt;name('show');
  </code></pre>
  <p>but I can't show slug, I see localhost:8000/id
  error: Attempt to read property &quot;id&quot; on null</p>