title: Laravel confirm delete in an alert in my view
body: <p>This should be a simple task  I am just not fully grasping laravel yet.
  I have my controllers view and models setup. I want to use my users.destroy route to delete my row in the db. But I want to do it a certain way.  I want to have an alert show In my alert area on my page asking to confirm the deletion of a certain user. Im assuming I need to pass the user id in a session to an alert to confirm my delete on a delete button click.
  Click 1 button to open an alert on the top of my page if I click confirm it calls user.destroy.</p>
  
  <p><strong>View:</strong></p>
  
  <pre><code>&lt;div class="container"&gt;
    &lt;div class="row justify-content-center"&gt;
      &lt;div class="col-md-12"&gt;
        &lt;div class="card"&gt;
          &lt;div class="card-header"&gt;
            &lt;h4&gt;View All Users&lt;/h4&gt;
  
            @if(session()-&gt;get('success'))
            &lt;div class="alert alert-success"&gt;
              {{ session()-&gt;get('success') }}
            &lt;/div&gt;
            @endif
            @if(session()-&gt;get('danger'))
            &lt;div class="alert alert-danger"&gt;
              {{ session()-&gt;get('danger') }}
            &lt;/div&gt;
            @endif
          &lt;/div&gt;
          &lt;div class="card-body"&gt;
            &lt;div class="text-center my-2"&gt;
              &lt;a href="{{ route('register') }}" class="btn btn-primary"&gt;New User&lt;/a&gt;
            &lt;/div&gt;
            &lt;div&gt;
              &lt;table class="table table-striped table-bordered"&gt;
                &lt;thead&gt;
                  &lt;tr&gt;
                    &lt;th&gt;ID&lt;/th&gt;
                    &lt;th&gt;Name&lt;/th&gt;
                    &lt;th&gt;Email&lt;/th&gt;
                    &lt;th&gt;Username&lt;/th&gt;
                    &lt;th colspan="2"&gt;Actions&lt;/th&gt;
                  &lt;/tr&gt;
                &lt;/thead&gt;
                &lt;tbody&gt;
                  @foreach($users as $user)
                  &lt;tr&gt;
                    &lt;th&gt;{{$user-&gt;id}}&lt;/th&gt;
                    &lt;td&gt;{{$user-&gt;name}}&lt;/td&gt;
                    &lt;td&gt;{{$user-&gt;email}}&lt;/td&gt;
                    &lt;td&gt;{{$user-&gt;username}}&lt;/td&gt;
                    &lt;td class="text-center"&gt;
                      &lt;a href="{{ route('users.show', $user-&gt;id) }}" class="btn btn-primary mr-3"&gt;Show&lt;/a&gt;
                      &lt;a href="{{ route('users.edit', $user-&gt;id) }}" class="btn btn-info text-white ml-3"&gt;Edit&lt;/a&gt;
                      &lt;a href="#" class="btn btn-danger"&gt;Delete&lt;/a&gt;
                    &lt;/td&gt;
                  &lt;/tr&gt;
                  @endforeach
                &lt;/tbody&gt;
              &lt;/table&gt;
  </code></pre>
  
  <p><strong>Controller</strong>:</p>
  
  <pre><code>public function destroy($id)
  {
      User::find($id)-&gt;delete();
      return redirect()-&gt;route('users.index')-&gt;with('success','User Deleted');
  }
  </code></pre>
  
  <p><strong>Route:</strong></p>
  
  <pre><code>Route::resource('users', 'UserController');
  </code></pre>