我正在使用laravelboilerplate的最新回购我在服务器上遇到此错误。但它在宅基地上工作正常。
我尝试用户清除:缓存但它是一样的。
UnexpectedValueException in Route.php line 646:
Invalid route action: [App\Http\Controllers\Backend\Takeaway\addOnCategory\AddOnCategoryTableController]
,这是控制器中的代码
<code>
namespace App\Http\Controllers\Backend\Takeaway\AddOnCategory;
use App\Http\Controllers\Controller;
use App\Repositories\Backend\Takeaway\AddOnCategory\AddOnCategoryRepository;
use Yajra\Datatables\Facades\Datatables;
use App\Http\Requests\Request;
/**
* Class UserTableController
*/
class AddOnCategoryTableController extends Controller
{
/**
* @var UserRepository
*/
protected $addOnCategory;
/**
* @param UserRepository $users
*/
public function __construct(AddOnCategoryRepository $addOnCategory)
{
$this->addOnCategory = $addOnCategory;
}
/**
* @param ManageUserRequest $request
* @return mixed
*/
public function __invoke() {
return Datatables::of($this->addOnCategory->getForDataTable())
->addColumn('actions', function($addOnCategory) {
return $addOnCategory->action_buttons;
})
->make(true);
}
}
,这是路线中的代码
<code>
Route::group([
'prefix' => 'takeaway',
'as' => 'takeaway.',
'namespace' => 'Takeaway\addOnCategory',
], function() {
/**
* Settings Specific Functionality
*/
/**
* User CRUD
*/
Route::resource('/addOnCategory', 'AddOnCategoryController');
Route::get('addOnCat/get', 'AddOnCategoryTableController')->name('addOnCategory.get');
});
答案 0 :(得分:1)
您需要使用AddOnCategoryTableController
试试这个
Route::get('addOnCat/get', 'AddOnCategoryTableController@__invoke')->name('addOnCategory.get');