У меня проблема с административной частью сайта, который я делаю. Я включил на стороне администратора 4 ссылки, но когда я нажимаю на любую из них, я получаю эту ошибку:
SQLSTATE[42S02]: базовая таблица или представление не найдены: 1146 Таблица sonic.admins не существует (SQL: выберите * из
admins
, гдеid
= ограничение периферийных устройств 1)
Я понятия не имею, откуда берется этот SQL-запрос, поскольку, насколько мне известно, я его не запускаю.
Я использую следующий контроллер в качестве примера одной неработающей ссылки:
Route::resource('/admin/games', 'AdminGamesController', ['names'=>[
'index'=>'games.index',
'create'=>'games.create',
'store'=>'games.store',
'edit'=>'games.edit',
'show'=>'games.show',
'destroy'=>'games.destroy',
]]);
но
Route::resource('/admin', 'AdminController', ['names'=>[
'index'=>'admin.index',
'create'=>'admin.create',
'store'=>'admin.store',
'edit'=>'admin.edit',
'show'=>'admin.show',
'destroy'=>'admin.destroy',
]]);
работает отлично.
Вот контроллер, который я использую для приведенного выше примера маршрутизации:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class AdminGamesController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return 'test';
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
вот ссылки
<div class="list-group list-group-flush">
<a href="{{route('home.index')}}" class="list-group-item list-group-item-action"><i class="fas fa-home"></i> Home</a>
<a href="{{route('games.index')}}" class="list-group-item list-group-item-action"><i class="fas fa-home"></i> Games</a>
<a href="{{route('figures.index')}}" class="list-group-item list-group-item-action"><i class="fas fa-user-friends"></i> Figures</a>
<a href="{{route('guides.index')}}" class="list-group-item list-group-item-action"><i class="fas fa-user-friends"></i> Guides</a>
<a href="{{route('peripherals.index')}}" class="list-group-item list-group-item-action"><i class="fas fa-user-tie"></i> Peripherals</a>
</div>