How to add simple view other than Crud to Laravel Backpack

I’m trying to figure out how to add a simple view (without CRUD) to Laravel Backpack. I’ve found this article, however I can’t make it work.

I have added new controller and view, however I’m getting following error:

Method AppHttpControllersAdminRaportyController::setupRoutes does not exist.

I don’t understand the routes, what should I add to make it work?

Thank you

EDIT

I’ve changed the ::crud to ::get in my routes and I’m getting a different error: AppHttpControllersAdminRaportyParkingoweController is not invokable.

My routes (custom.php) file:

    <?php

// --------------------------
// Custom Backpack Routes
// --------------------------
// This route file is loaded automatically by BackpackBase.
// Routes you generate using BackpackGenerators will be placed here.

Route::group([
    'prefix'     => config('backpack.base.route_prefix', 'admin'),
    'middleware' => array_merge(
        (array) config('backpack.base.web_middleware', 'web'),
        (array) config('backpack.base.middleware_key', 'admin')
    ),
    'namespace'  => 'AppHttpControllersAdmin',
], function () { // custom admin routes
    Route::crud('opinie', 'OpinieCrudController');
    Route::crud('rezerwacje', 'RezerwacjeCrudController');
    Route::crud('uzytkownicy', 'UzytkownicyCrudController');
    Route::get('raporty', 'RaportyController');
}); // this should be the absolute last line of this file

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

It should be a simple fix, point to the method you want in that controller: when you’re using Route::get(), make sure to also specify the method you want to point to. It should be Route::get('[email protected]');, not Route::get('RaportyParkingoweController');.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x