Laravel 6 目标类 [App\Http\Controllers\Admin\Tracker]

我正在尝试删除一条记录,但收到此错误,该类不存在,我正在使用 Laravel 6,我希望您的帮助或建议

我不知道命名空间是否错误,尽管我已经检查过并且没问题,还是控制器中的某些内容

我已经查看了这些方法,但找不到解决方案我附上了我的驱动程序文件和路径

控制器

<?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->uri = 'tracker';

        $this->perm = str_replace('_', '.', $this->uri);

        //$subdomain = \Route::current()->parameter('subdomain');

        $this->middleware('permission:'. $this->perm .'.create', ['only' => ['create', 'store']]);

        $this->middleware('permission:'. $this->perm .'.create', ['only' => ['create', 'store']]);

        $this->middleware('permission:'. $this->perm .'.read', ['only' => ['show']]);

        $this->middleware('permission:'. $this->perm .'.update', ['only' => ['edit', 'update','activate', 'confirmActivate']]);

        $this->middleware('permission:'. $this->perm .'.delete', ['only' => ['destroy', 'confirmDestroy']]);

        $this->middleware("one.permission:{$this->perm}.create&{$this->perm}.read&{$this->perm}.update&{$this->perm}.delete",

            ['only' => ['index']]);

    }

    /**

     * Display a listing of the resource.

     *

     * @return \Illuminate\Http\Response

     */

    public function index(Request $request)

    {

        $q = null;

        $uri = $this->uri;

        $user = Auth::user();

        $perm = $this->perm;

        $title = trans_choice('app.' . $uri . '.title', 2);


        $items = Tracker::orderBy('purchased_at', 'desc');


        if($request->has('q')){

            $q = $request->input('q');

            $items->where('id', 'like', "%$q%");

        }


    }

路线

 Route::get('tracker/{post}/destroy', 'Admin\Tracker@confirmDestroy');
        Route::resource('tracker', 'Admin\TrackerController');





HUX布斯
浏览 95回答 1
1回答

一只名叫tom的猫

我想你是在一个团体中,输入这条路线:Route::get('tracker/{post}/destroy',&nbsp;'Admin\Tracker@confirmDestroy');您忘记了控制器后缀:Route::get('tracker/{post}/destroy',&nbsp;'Admin\TrackerController@confirmDestroy');
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Html5