title: Delete Function: Laravel 5
body: <p>new to laravel framework here. I'm having quite a problem here calling out the delete function in my resource controller. Seems like it is not deleting the selected id. Thanks for your help in advance.</p>
  
  <p>resources/views/bufashaccts/allAccounts.blade.php</p>
  
  <pre><code>@extends('adminlte::page')
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;view accounts!&lt;/h1&gt;
  @foreach($bfaccounts as $userAccount)
      &lt;p&gt;{{ $userAccount-&gt;acct_firstname }}&lt;/p&gt;&lt;br&gt;
      &lt;p&gt;{{ $userAccount-&gt;acct_middlename }}&lt;/p&gt;&lt;br&gt;
      &lt;p&gt;{{ $userAccount-&gt;acct_lastname }}&lt;/p&gt;
      @if ($userAccount-&gt;id)
          &lt;form action="/Accounts" method="POST"&gt;
              {{ csrf_field() }}
              {{ method_field('DELETE') }}
              &lt;a href="/Accounts"&gt;
                  &lt;button type="button"&gt;delete&lt;/button&gt;
              &lt;/a&gt;
          &lt;/form&gt;
      @endif
      &lt;a href="/Accounts/{{ $userAccount-&gt;id }}/edit"&gt;
          &lt;button type="button"&gt;edit&lt;/button&gt;
      &lt;/a&gt;
  @endforeach
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>app/http/controllers/AccountsController.php</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use App\bufashaccounts;
  use Illuminate\Http\Request;
  
  class AccountsController extends Controller
  {
  
      public function index()
      {
          $bfaccounts = bufashaccounts::all();
  
          return view('bufashaccts.allAccounts', compact('bfaccounts'));
      }
  
      public function create()
      {
          return view('bufashaccts.addAccounts');
      }
  
      public function store(Request $request)
      {
          bufashaccounts::create($request-&gt;all());
  
          return "success!";
      }
  
      public function show($id)
      {
          $bfshowAccounts = bufashaccounts::findOrFail($id);
  
          return view('bufashaccts.viewAccounts', compact('bfshowAccounts'));
          //return $bfshowAccounts;
      }
  
      public function edit($id)
      {
          $bfeditAccounts = bufashaccounts::findOrFail($id);
  
          return view('bufashaccts.editAccounts', compact('bfeditAccounts'));
      }
  
      public function update(Request $request, $id)
      {
          $bfeditAccounts = bufashaccounts::find($id);
          $bfeditAccounts-&gt;update($request-&gt;all());
  
          return redirect('Accounts');
      }
  
      public function destroy($id)
      {
          //$bfdeleteAccounts = bufashaccounts::findOrFail($id);
          //$bfdeleteAccounts-&gt;delete();
          //return 'delete';
          $bfaccounts = bufashaccounts::findOrFail($id);
          $bfeditAccounts-&gt;delete();
  
          //return view('bufashaccts.allAccounts', compact('bfaccounts'));
          return redirect('/Accounts');
      }
  }
  </code></pre>