Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

How to add new permission to new route using new controller?

Chomnit Chouy   ( User )

Commented 4 years ago

I have added new controller and few functions, it also create permission then assign permission to the role that I am in. However, I always get redirected to home page everytime I try to access to the new route. Any ideas?

Denis Duliçi   ( Admin )

Commented 4 years ago

Chomnit, can you write the route details and controller path here?

Wisdom Oppong yeboah   ( User )

Commented 4 years ago

Hi Denis,


i am experiencing the same problems as Chomnit. my route keeps redirecting to dashboard('/')


 


i added a new resource controller MajorClasses in ‪akaunting\app\Http\Controllers\Items\MajorClasses.php


my route:


Route::group(['prefix' => 'items'], function () {

Route::resource('majorClasses', 'Items\MajorClasses');


});

 

Cedric Clancy   ( User )

Commented 3 years ago

Hello everyone,


did anyone find a solution to this yet? I am experiencing the same thing and have spent a better part of today trying to fix it without luck.


Cedlinx

Cedric Clancy   ( User )

Commented 3 years ago

 Hello everyone,


I eventually resolved this using the Modules feature as explained here (https://akaunting.com/docs/developer-manual/modules). It is actually very easy and makes it look like you are building a separate Laravel app. Once you install a module, it has its own Controllers, Models, Views, Routes folders and so on. Treat this module as a separate application and put everything where they should be and you shouldn't have any problems.


Hope this helps someone out there.


Cedlinx.

Israel   ( User )

Commented 3 years ago

Hi Friends , I`m solve this problem ,
It`s not difficult, Just follow the same architecture .

1) create route
2) create new Controller,Request and model for your custom controller.
3) add menu link in middleware/AdminMenu.php.
4) add new permission for your custom controller through admin panel.
5) allow permission to your role.
6) then create middleware Like LoadCurrency.php ( This is important step because its not set, the redirectifauthendication file will be redirect to the dashboard).

Try it its work for me.
thank you.

Please login or register to leave a response.

Showing 1 to 6 of 6 discussions