konradkalemba / blade-components-scoped-slots

Scoped slots feature addition to Laravel's Blade templating engine
MIT License
27 stars 6 forks source link

Let @scopedslot directive be used sans parenthesis #6

Open logan-christensen opened 1 year ago

logan-christensen commented 1 year ago

I often use the @scopedslot directive while passing only a single variable:

@scopedslot('name', ($user))
...
@endscopedslot

This PR would make the parenthesis syntax around the function arguments optional.

@scopedslot('name', $user)
...
@endscopedslot

My reasoning is as follows:

  1. I would prefer not to type parenthesis every time
  2. My code formatter (vscode-blade-formatter) will remove all parenthesis around a single variable and it causes errors.