title: Attempt to read property "id" on null - show.blade.php
body: <p>I don't understand at all why I have this mistake:
  <code>Attempt to read property &quot;id&quot; on null (View: C:\xampp\htdocs\resources\views\admin\employees\show.blade.php)</code></p>
  <p>show.blade.php</p>
  <pre><code>'Category' =&gt; '&lt;a href=&quot;'. route('admin.employee-categories.show', $model-&gt;category-&gt;id) . '&quot;&gt;' . $model-&gt;category-&gt;name . '&lt;/a&gt;',
  </code></pre>
  <p>Model Empolyee</p>
  <pre><code>    public function category(): BelongsTo
      {
          return $this-&gt;belongsTo(EmployeeCategory::class, 'category_id');
      }
  </code></pre>
  <p>I try:</p>
  <pre><code>'Category' =&gt; '&lt;a href=&quot;'. route('admin.employee-categories.show', $model-&gt;category ? $model-&gt;category-&gt;id: '') . '&quot;&gt;' . $model-&gt;category ? $model-&gt;category-&gt;name : ' ' . '&lt;/a&gt;',
  </code></pre>
  <p>But then I have mistake - <code>Attempt to read property &quot;name&quot; on null (View: C:\xampp\htdocs\resources\views\admin\employees\show.blade.php) </code></p>
  <p><strong>UPD:</strong></p>
  <p>In index.blade.php I SoftDelete one Employee.</p>
  <p>Then I go to index.blade.php for EmployeeCertificates.</p>
  <p>But then I should to see that Employee was deleted.</p>
  <p>But I have <code>Attempt to read property &quot;name&quot; on null (View: C:\xampp\htdocs\resources\views\components\data-table.blade.php) </code></p>
  <p><strong>EmployeeCertificates index.blade.php:</strong></p>
  <pre><code>                       [
                              'attribute' =&gt; function($item) { return $item-&gt;employee-&gt;name; },
                              'label' =&gt; 'Сотрудник',
                              'style' =&gt; 'width: 30%; min-width: 200px;',
                              'filter' =&gt; [
                                  'class' =&gt; \App\View\Components\Filters\Select::class,
                                  'params' =&gt; [
                                      'name' =&gt; 'employee_id',
                                      'options' =&gt; $employees-&gt;pluck('name', 'id')-&gt;toArray(),
                                      'value' =&gt; request()-&gt;get('employee_id', ''),
                                      'htmlAttributes' =&gt; '',
                                  ],
                              ],
                          ],
  </code></pre>
  <p><strong>Employee model:</strong></p>
  <pre><code>    public function certificates(): HasMany
      {
          return $this-&gt;hasMany(EmployeeCertificate::class, 'employee_id');
      }
  </code></pre>