-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[7.x] Parameterless Component Methods Invokable With & Without Parens #32560
Conversation
For the record, this fixes a concern brought up in laravel/ideas#2129 I still think this is a backwards-incompatible change. Say we have a function on the Blade component: public function foo()
{
return 'bar';
} Which in turn we used in the Blade with Prior to this change, With this change, it would now only execute the I'm not using the former behaviour myself, but still, see it as a breaking change. I like the change and more consistent behaviour myself and would love to see it in 8.x Edit: I'd also note that this doesn't fix the discrepancy between whether or not |
I'm not particularly concerned about that breaking change as I very sincerely doubt anyone is doing that. |
Because we need the feature from laravel/framework#32560
Because we need the feature from laravel/framework#32560
Because we need the feature from laravel/framework#32560
This change allows parameterless Blade component methods to be invoked using no parameters or using parameters:
It's easy to forget that these methods currently are not able to called with parentheses. I have stumbled on this myself. This should be backward compatible since both ways of echoing the value are supported.