title: I Want to Disable Delete Button Base On auth()->user()->id (LARAVEL 8)
body: <p>I have make Users Index where on that table displaying all user data except Password and at the last field i put action for Delete user. The problem is i want to disable delete button only for the user who login at that time. But what i have done is all user delete button disable, please help me how to solve this. i have trying to find tutoril but didn't  find yet. Below my condition code:</p>
  <pre><code>@if (auth()-&gt;user()-&gt;id)
      &lt;button class=&quot;btn btn-outline-danger
      btn-xs&quot; disabled&gt;&lt;i class=&quot;fe fe-trash&quot;&gt;&lt;/i&gt;Delete&lt;/button&gt;
  @else
      &lt;button class=&quot;btn btn-outline-danger
      btn-xs&quot;&gt;&lt;i class=&quot;fe fe-trash&quot;&gt;&lt;/i&gt;Delete&lt;/button&gt;
  @endif
  </code></pre>
  <p>In UserController to display all user data i use this code:</p>
  <pre><code>public function index(){
      $users = User::all();
      return view('admin.users.index', ['users'=&gt; $users]);
  }
  </code></pre>
  <p>in index.blade i aplly this code to display all data:</p>
  <pre><code>&lt;table id=&quot;dataTableBasic&quot; class=&quot;table&quot; style=&quot;width:100%&quot;&gt;
      &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;{{ __('Username') }}&lt;/th&gt;
          &lt;th&gt;{{ __('Name') }}&lt;/th&gt;
          &lt;th&gt;{{ __('Email') }}&lt;/th&gt;
          &lt;th&gt;{{ __('Role') }}&lt;/th&gt;
          &lt;th&gt;{{ __('Posts') }}&lt;/th&gt;
          &lt;th&gt;{{ __('Action') }}&lt;/th&gt;
      &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
      @foreach($users as $user)
      &lt;tr&gt;
          &lt;td&gt;&lt;a href=&quot;{{route('user.profile.show', $user-&gt;id)}}&quot; class=&quot;text-inherit link-primary&quot;&gt;{{$user-&gt;username}}&lt;/a&gt;&lt;/td&gt;
          &lt;td&gt;{{$user-&gt;name}}&lt;/td&gt;
          &lt;td&gt;&lt;a href=&quot;mailto:{{$user-&gt;email}}&quot; class=&quot;text-inherit link-primary&quot;&gt;{{$user-&gt;email}}&lt;/a&gt;&lt;/td&gt;
          &lt;td&gt;Administrator&lt;/td&gt;
          &lt;td&gt;&lt;a href=&quot;#&quot; class=&quot;text-inherit&quot;&gt;100&lt;/a&gt;&lt;/td&gt;
          &lt;td&gt;
              &lt;form action=&quot;{{route('users.destroy',$user-&gt;id)}}&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;
                  @csrf
                  @method('DELETE')
                  @if (auth()-&gt;user()-&gt;id)
                      &lt;button class=&quot;btn btn-outline-danger btn-xs&quot; disabled&gt;&lt;i class=&quot;fe fe-trash&quot;&gt;&lt;/i&gt;{{ __('Hapus') }}&lt;/button&gt;
                  @else
                      &lt;button class=&quot;btn btn-outline-danger btn-xs&quot;&gt;&lt;i class=&quot;fe fe-trash&quot;&gt;&lt;/i&gt;{{ __('Hapus') }}&lt;/button&gt;
                  @endif
              &lt;/form&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      @endforeach
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  <p>Below the screenshot:
  <img src="https://i.stack.imgur.com/Zzy8v.png" alt="enter image description here" /></p>