我正在尝试删除一条记录,但收到此错误,该类不存在,我正在使用 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');
一只名叫tom的猫
相关分类