title: Laravel 6 Target class [App\Http\Controllers\Admin\Tracker] does not exist
body: <p>I am trying to delete a record but I get this error that this class does not exist, I am using Laravel 6, I hope your help or advice</p>
  <p>I don't know if the namespace is wrong although I have checked and it is ok, or something in the controller</p>
  <p>I have reviewed the methods and cannot find a solution
  I attach my driver file and my path</p>
  <h1>Controller</h1>
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers\Admin;
  
  use App\Events\InstanceCreated;
  use App\Pesvial\City;
  use App\Pesvial\Instance;
  use App\Pesvial\Tracker;
  use App\Pesvial\TrackingServer;
  use Illuminate\Http\Request;
  use App\Pesvial\Vehicle;
  use App\Http\Controllers\Controller;
  use Auth;
  
  class TrackerController extends Controller
  {
      public function __construct( )
      {
          $this-&gt;uri = 'tracker';
          $this-&gt;perm = str_replace('_', '.', $this-&gt;uri);
          //$subdomain = \Route::current()-&gt;parameter('subdomain');
          $this-&gt;middleware('permission:'. $this-&gt;perm .'.create', ['only' =&gt; ['create', 'store']]);
          $this-&gt;middleware('permission:'. $this-&gt;perm .'.create', ['only' =&gt; ['create', 'store']]);
          $this-&gt;middleware('permission:'. $this-&gt;perm .'.read', ['only' =&gt; ['show']]);
          $this-&gt;middleware('permission:'. $this-&gt;perm .'.update', ['only' =&gt; ['edit', 'update','activate', 'confirmActivate']]);
          $this-&gt;middleware('permission:'. $this-&gt;perm .'.delete', ['only' =&gt; ['destroy', 'confirmDestroy']]);
          $this-&gt;middleware(&quot;one.permission:{$this-&gt;perm}.create&amp;{$this-&gt;perm}.read&amp;{$this-&gt;perm}.update&amp;{$this-&gt;perm}.delete&quot;,
              ['only' =&gt; ['index']]);
      }
      /**
       * Display a listing of the resource.
       *
       * @return \Illuminate\Http\Response
       */
      public function index(Request $request)
      {
          $q = null;
          $uri = $this-&gt;uri;
          $user = Auth::user();
          $perm = $this-&gt;perm;
          $title = trans_choice('app.' . $uri . '.title', 2);
  
          $items = Tracker::orderBy('purchased_at', 'desc');
  
          if($request-&gt;has('q')){
              $q = $request-&gt;input('q');
              $items-&gt;where('id', 'like', &quot;%$q%&quot;);
          }
  
          $items = $items-&gt;paginate(20);
  
  
          // Show the page
          return view('chameleon.admin.'. $this-&gt;uri .'.index', compact('items', 'user', 'uri','q','perm','title'));
      }
  
      /**
       * Show the form for creating a new resource.
       *
       * @return \Illuminate\Http\Response
       */
      public function create()
      {
          $uri = $this-&gt;uri;
          $tracking_servers = TrackingServer::orderBy('name','asc')-&gt;get();
          return view('chameleon.admin.'. $this-&gt;uri .'.create_edit', compact('uri', 'max_file_size', 'terms','title', 'instances', 'cities','tracking_servers'));
      }
  
      /**
       * Store a newly created resource in storage.
       *
       * @param  \Illuminate\Http\Request  $request
       * @return \Illuminate\Http\Response
       */
      public function store(Request $request)
      {
          $rules = [
              'unique_id'   =&gt; 'required|unique:trackers,id',
              'tracking_server'   =&gt; 'required',
              'purchased_at' =&gt; 'nullable|date_format:Y-m-d',
          ];
  
          $this-&gt;validate($request, $rules);
  
          $item = new Tracker;
          $item-&gt;id = $request-&gt;input('unique_id');
          $item-&gt;serial = $request-&gt;input('serial');
          $item-&gt;purchased_at = $request-&gt;input('purchased_at');
          $item-&gt;password = $request-&gt;input('password', null);
          $item-&gt;invoice = $request-&gt;input('invoice', null);
          $item-&gt;brand = $request-&gt;input('brand', null);
          $item-&gt;model = $request-&gt;input('model', null);
          $item-&gt;observations = $request-&gt;input('comments');
          $item-&gt;state = $request-&gt;input('state');
          $item-&gt;tracking_server_id = $request-&gt;input('tracking_server', null);
  
          if ($item-&gt;save())
          {
              if (!$request-&gt;has('already_exists'))
              {
  
              }
          return redirect('/admin/'. $this-&gt;uri)-&gt;with('success', trans('app.' . $this-&gt;uri . '.store_success', ['name' =&gt; $item-&gt;name]));
          }
          return redirect('/admin/'. $this-&gt;uri)-&gt;with('error', trans('app.' . $this-&gt;uri . '.store_fail'));
      }
  
  
      /**
       * Display the specified resource.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function show($id)
      {
          return redirect('/admin/' . $this-&gt;uri);
      }
  
      /**
       * Show the form for editing the specified resource.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function edit($id)
      {
          $item = Tracker::findOrFail($id);
          $uri = $this-&gt;uri;
          $tracking_servers = TrackingServer::orderBy('name', 'asc')-&gt;get();
          return view('chameleon.admin.'. $this-&gt;uri .'.create_edit', compact('item','uri', 'tracking_servers'));
      }
  
      /**
       * Update the specified resource in storage.
       *
       * @param  \Illuminate\Http\Request  $request
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function update(Request $request, $id)
      {
          $rules = [
              'unique_id'   =&gt; 'required|unique:trackers,id',
              'tracking_server'   =&gt; 'required',
              'purchased_at' =&gt; 'nullable|date_format:Y-m-d',
          ];
  
          $this-&gt;validate($request, $rules);
  
          $item = new Tracker;
          $item-&gt;id = $request-&gt;input('unique_id');
          $item-&gt;serial = $request-&gt;input('serial');
          $item-&gt;purchased_at = $request-&gt;input('purchased_at');
          $item-&gt;password = $request-&gt;input('password', null);
          $item-&gt;invoice = $request-&gt;input('invoice', null);
          $item-&gt;brand = $request-&gt;input('brand', null);
          $item-&gt;model = $request-&gt;input('model', null);
          $item-&gt;observations = $request-&gt;input('comments');
          $item-&gt;state = $request-&gt;input('state');
          $item-&gt;tracking_server_id = $request-&gt;input('tracking_server', null);
  
          if ($item-&gt;save())
          {
              return redirect('/admin/'. $this-&gt;uri)-&gt;with('success', trans('app.' . $this-&gt;uri . '.store_success', ['name' =&gt; $item-&gt;name]));
          }
          return redirect('/admin/'. $this-&gt;uri)-&gt;with('error', trans('app.' . $this-&gt;uri . '.store_fail'));
  
      }
  
      public function confirmDestroy($id)
      {
          $item = Tracker::findOrFail($id);
          $uri = $this-&gt;uri;
          $title = __(&quot;app.{$uri}.destroy&quot;);
          $page = session('cur_page');
          if(!$page){
              $page = 1;
          }
          return view(&quot;chameleon.admin.{$this-&gt;uri }.destroy&quot;, compact('item', 'uri', 'title', 'page'));
      }
  
      /**
       * Remove the specified resource from storage.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function destroy($id)
      {
          $item = Tracker::findorFail($id);
              if($item-&gt;delete())
              {
              return redirect('/admin/'. $this-&gt;uri)-&gt;with('success', trans('app.' . $this-&gt;uri . '.destroy_success'));
          }
          return redirect('/admin/'. $this-&gt;uri)-&gt;with('error', trans('app.' . $this-&gt;uri . '.destroy_fail'));
      }
      public function itemsList()
      {
          $res = Tracker::get();
          $ret = [];
          if($res-&gt;count() &gt; 0)
          {
              foreach ($res as $key =&gt; $value) {
                  $ret[$key]['id'] = $value-&gt;id;
              }
          }
          return response()-&gt;json($ret);
      }
  
      public function map($subdomain)
      {
          $instance = Instance::where('subdomain', $subdomain)-&gt;first();
          if(!$instance)
          {
              abort(404);
          }
          $server = $instance-&gt;trackingServer;
          return view('instances.'. $this-&gt;uri .'.map', compact('item', 'uri', 'instance', 'server'));
      }
      public function trackersList()
      {
          $res = Tracker::orderBy('id', 'asc')-&gt;get();
          $ret = [];
          if($res-&gt;count() &gt; 0)
          {
              foreach ($res as $key =&gt; $value) {
                  $ret[$key]['id'] = $value-&gt;id;
                  $ret[$key]['name'] = $value-&gt;id ;
              }
          }
          return response()-&gt;json($ret);
      }
  
      public function find(Request $request, $q)
      {
          if($request-&gt;ajax()){
              //$items = Tracker::availableTrackers($q);
              $items = Tracker::where('id', 'like', &quot;%$q%&quot;)-&gt;get();
              $ret = [];
              foreach ($items as $key =&gt; $value) {
                  $name = $value['id'];
                  if($value['brand']){
                      $name .= &quot; &quot; . $value['brand'];
                  }
  
                  if($value['model']){
                      $name .= &quot; &quot; . $value['model'];
                  }
                  $ret[$key]['id'] = $value['id'];
                  $ret[$key]['name'] = $name ;
                  $ret[$key]['password'] = Helper::trackerPassword($value['id']);
              }
              return response()-&gt;json($ret);
          }
      }
  
      public function availableTrackersList(){
          $trackers = Tracker::availableTrackers();
          //print_r($trackers);
          $ret = [];
          foreach ($trackers as $key =&gt; $tracker){
              $ret[$key]['id'] = $tracker['id'];
              $ret[$key]['name'] = $tracker['id'];
          }
          return response()-&gt;json($ret);
      }
  
      public function dataTable(Request $request)
      {
          if($request-&gt;ajax()){
  
              $items = Tracker::orderBy(&quot;id&quot;, &quot;asc&quot;)-&gt;get();
  
              $ret = [];
              foreach ($items as $key =&gt; $item) {
                  $vehicle = $item-&gt;vehicle()-&gt;orderBy('start_at', 'desc')-&gt;first();
                  $server = $item-&gt;trackingServer;
  
                  array_push($ret, [
                      'imei' =&gt; $item-&gt;id,
                      'server' =&gt; $server ? $server-&gt;name : 'ND',
                      'vehicle' =&gt; $vehicle ? $vehicle-&gt;plate : &quot;No asignado&quot;,
                      'from' =&gt; $vehicle ? $vehicle-&gt;pivot-&gt;start_at : '',
                      'to' =&gt; $vehicle &amp;&amp; $vehicle-&gt;pivot-&gt;finish_at ? $vehicle-&gt;pivot-&gt;finish_at : 'Indefinido',
                      'replaced' =&gt; $vehicle &amp;&amp; $vehicle-&gt;pivot-&gt;finished_at ? $vehicle-&gt;pivot-&gt;finished_at : '',
                      'fimei' =&gt; $item-&gt;id,
                  ]);
  
              }
              return response()-&gt;json($ret);
          }
      }
  }
  
  </code></pre>
  <h1>Routes</h1>
  <pre><code> Route::get('tracker/{post}/destroy', 'Admin\Tracker@confirmDestroy');
          Route::resource('tracker', 'Admin\TrackerController');
  </code></pre>