-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter option not working on menus with user role permissions #308
Comments
@lavary , @cgrice , @uyab , @afraca , @DMeganoski , Can you please help me to short out this issue? |
I'm sorry @mtkumar82 , it's been 3 years since I last used this and do not have the means to help you with this. |
Hello @afraca , Thanks for your quick message, Actually when I am using filter function there , and trying to add some echo statement there with die, Its not doing anything there. I actually want to show menus, based on user role and permissions. For user role and permissions I am using spatie/laravel-permission extension, Please let me know if you understand my problem? Thanks |
@mtkumar82 Issues is not really the place to ask this, you'd be better on stack overflow or a forum for laravel like laracasts. Github issues is more to report a bug in the repository, this is a bug in your app. But I will throw you a bone and tell you what your problem likely is. Your filter function is using |
Hello @DMeganoski , Thanks for your reply, But I short out that issue, I need to put that filter function in end of menus collections like below.
Sharing it here, May be someone else can get help from this. Thanks again. |
Hi,
I am using your extension to create menu in my application and did all the settings as per extension settings, I want to show menu's in my application based on user permissions set by Admin user for each user role, I am trying to use Filter function of menu, But its not working in my application below is code of my middleware.
namespace Modules\AmazonRepricer\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
//use Symfony\Component\HttpFoundation\Response;
use Auth;
//use Modules\AmazonRepricer\Http\Controllers\AmazonRepricerItemsController;
//use Modules\AmazonRepricer\Http\Controllers\AmazonDefectiveProductController;
use app\Models\User;
class AdminMenus
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle(Request $request, Closure $next)
{
//if (Auth::guard('admin')->check() && (Auth::guard('admin')->user()->role_id == 1 || Auth::guard('admin')->user()->role_id == 4)) {
}
Please check help me where I am making the mistake and its not working for me?
Thanks
The text was updated successfully, but these errors were encountered: