Cant find admin middleware's path called in many controllers.



  • i see in may controller inside the package, inside the constructor an admin middleware was called. i am having a hard time finding the location of this admin middleware



  • Hello @nahiyan-aziz ,
    Can you please elaborate this, so that we can find a solution in a better way.
    Thank you .



  • i had just installed bagisto... i was exploring it. i see in some controllers, for user role management, admin middleware was used. lets say in a package like Admin->src->Http->Sales->InvoiceController
    in Invoice controller admin middleware was called
    public function __construct( OrderRepository $orderRepository,
    InvoiceRepository $invoiceRepository
    )
    {

        $this->middleware('admin'); /// the path im searching for
    
        $this->_config = request('_config');
    
        $this->orderRepository = $orderRepository;
    
        $this->invoiceRepository = $invoiceRepository;
    }
    

    now here, i cant find the path of this admin middleware used in constructor



  • Hi @nahiyan-aziz ,
    You may check the following file :
    Goto packages/Webkul/User/src/Http/Middleware/Bouncer.php
    Thank you.


Log in to reply