Laravel Gate::define easy code

You can us the following code define your all gates. Permission table has got the control name,action and models

This code is ok for small web application. If your project is gig with several user role this code is not going to work because you have to use lots of If – else condition check whether the given user has permission to specified resource