title: give approve and reject function to the button and display it in user's dashboard in Laravel
body: <p>I want to give function to both approve and reject button that is in admin dashboard and display the result in user's dashboard.</p>
  
  <p>here is my admin view </p>
  
  <p>dashboard.php.blade</p>
  
  <pre><code>&lt;div class="card-body"&gt;
          &lt;div class="table-responsive"&gt;
            &lt;table class="table"&gt;
              &lt;thead class=" text-primary"&gt;
              &lt;th&gt;ID&lt;/th&gt;
              &lt;th&gt;Name&lt;/th&gt;
              &lt;th&gt;Leave Type&lt;/th&gt;
              &lt;th&gt;Leave Start date&lt;/th&gt;
              &lt;th&gt;Leave End date&lt;/th&gt;
              &lt;th&gt;Remark&lt;/th&gt;
              &lt;th&gt;Approve&lt;/th&gt;
              &lt;th&gt;Decline&lt;/th&gt;  
              &lt;/thead&gt;
              &lt;tbody&gt; 
                @foreach ($leaves as $leave)          
                &lt;tr&gt;
                  &lt;td&gt;{{$leave-&gt;id}}&lt;/td&gt;
                  &lt;td&gt;{{$leave-&gt;applied_by-&gt;name}}&lt;/td&gt;
                  &lt;td&gt;{{$leave-&gt;type-&gt;type}}&lt;/td&gt;
                  &lt;td&gt;{{$leave-&gt;start}}&lt;/td&gt;
                  &lt;td&gt;{{$leave-&gt;end}}&lt;/td&gt;
                  &lt;td&gt;{{$leave-&gt;remarks}}&lt;/td&gt;
                  &lt;td&gt;
                      &lt;a href="#" class="btn btn-success"&gt;Approve&lt;/a&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      &lt;a href="#" class="btn btn-danger"&gt;Decline&lt;/a&gt;
  </code></pre>
  
  <p>AdminLeaveController.php .. Do not have any method yet</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use App\Models\Leave;
  use App\Models\LeaveType;
  use App\User;
  
  class AdminLeave extends Controller
  {
      public function leaveapproval()
      {
          $leaves = Leave::with('type', 'applied_by')-&gt;get();
          return view ('admin.dashboard',compact ('leaves'));
      }
  }
  </code></pre>