1 min readMar 8, 2018
Hi Vipul,
You could create a custom Service Provider where you place the custom Blade directive. See the following example:
In your Blade view you can call the directive with the following code:
@edit(param1, param2, param3)
I didn’t create the full functionality you wanted so you can try it yourself to see if you understand how it works. Unfortunately, Blade directives don’t allow multiple arguments so you will have to find a way to deal with that, but I think it’s possible to get what you want. You can find a example of passing objects to your directive here.