title: Call to a member function detail() on bool laravel 8
body: <p>my product model</p>
  <pre><code>    public function detail(){
  
      return $this-&gt;hasOne('App\Models\ProductDetails');
  }
  </code></pre>
  <p>my productDetails model</p>
  <pre><code>protected $table='product_details';
  public $timestamps=false;
  protected $fillable=['product_id' , 'show_slider','show_opportunity_day','show_featured','show_bestseller','show_discounted'];
  
  public function detail(){
  
      return $this-&gt;belongsTo('App\Models\Products');
  }
  </code></pre>
  <p>my ProductTableSeeder</p>
  <pre><code>       DB::table('products')-&gt;truncate();
      DB::table('product_details')-&gt;truncate();
      $products=[
          [&quot;product_name&quot;=&gt;&quot;Domates Çorbası&quot;, &quot;slug&quot;=&gt;'Domates Çorbası', 'content'=&gt;&quot;en iyi ürün&quot;,&quot;price&quot;=&gt;20 ],
          [&quot;product_name&quot;=&gt;&quot;Yayla Çorbası&quot;, &quot;slug&quot;=&gt;&quot;Yayla Çorbası&quot;, &quot;content&quot;=&gt;&quot;en iyi ürün&quot;,&quot;price&quot;=&gt;30],
          [&quot;product_name&quot;=&gt;&quot;Kelle Paça Çorbası&quot;, &quot;slug&quot;=&gt;&quot;Kelle Paça Çorbası&quot;, &quot;content&quot;=&gt;&quot;en iyi ürün&quot;,&quot;price&quot;=&gt;20],
          [&quot;product_name&quot;=&gt;&quot;Tarhana Çorbası&quot;,&quot;slug&quot;=&gt;&quot;Tarhana Çorbası&quot;, &quot;content&quot;=&gt;&quot;en iyi ürün&quot;,&quot;price&quot;=&gt;40 ],
          [&quot;product_name&quot;=&gt;&quot;Tavuk Çorbası&quot;, &quot;slug&quot;=&gt;&quot;Tavuk Çorbası&quot;, &quot;content&quot;=&gt;&quot;en iyi ürün&quot;,&quot;price&quot;=&gt;10  ],
          [&quot;product_name&quot;=&gt;&quot;Mercimek Çorbası&quot;, &quot;slug&quot;=&gt;&quot;Mercimek Çorbası&quot;, &quot;content&quot;=&gt;&quot;en iyi ürün&quot;,&quot;price&quot;=&gt;15 ],
          [&quot;product_name&quot;=&gt;&quot;Kereviz Çorbası&quot;, &quot;slug&quot;=&gt;&quot;Kereviz Çorbası&quot;, &quot;content&quot;=&gt;&quot;en iyi ürün&quot;,&quot;price&quot;=&gt;25 ],
          [&quot;product_name&quot;=&gt;&quot;Şehriyeli Çorba&quot;, &quot;slug&quot;=&gt;&quot;Şehriyeli Çorba&quot;, &quot;content&quot;=&gt;&quot;en iyi ürün&quot;,&quot;price&quot;=&gt;22 ],
          [&quot;product_name&quot;=&gt;&quot;Havuçlu Kabak Çorbası&quot;, &quot;slug&quot;=&gt;&quot;Havuçlu Kabak Çorbası&quot;, &quot;content&quot;=&gt;&quot;en iyi ürün&quot;,&quot;price&quot;=&gt;14],
          [&quot;product_name&quot;=&gt;&quot;Ayran Çorbası&quot;, &quot;slug&quot;=&gt;&quot;Ayran Çorbası&quot;, &quot;content&quot;=&gt;&quot;en iyi ürün&quot;,&quot;price&quot;=&gt;20 ]
      ];
      foreach($products as $product){
      DB::table('products')-&gt;insert($products);
      $detail=$product-&gt;detail()-&gt;create([
          'show_slider'=&gt;rand(0,1),
          'show_opportunity_day'=&gt;rand(0,1),
          'show_featured'=&gt;rand(0,1),
          'show_bestseller'=&gt;rand(0,1),
          'show_discounted'=&gt;rand(0,1)
      ]);
      }
  </code></pre>
  <p>$ product is not defined in the seeder section and when I save and refresh the page I get an error---&gt;
  Call to a member function detail() on bool</p>