You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The once() function is not operating correctly when inside a Blade component. I'm thinking this is a bug, because the README says it should only execute once "per request".
To recreate, make a simple component:
namespaceApp\View\Components\Admin\Buttons;
useIlluminate\View\Component;
classNumberextendsComponent
{
/** * Create a new component instance. */publicfunction__construct() {}
/** * Get the view / contents that represent the component. */publicfunctionrender(): string
{
returnonce(fn() => rand(0, 100));
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The
once()
function is not operating correctly when inside a Blade component. I'm thinking this is a bug, because the README says it should only execute once "per request".To recreate, make a simple component:
Then use this component multiple times in a view:
Each of these is coming back with a different random number.
Beta Was this translation helpful? Give feedback.
All reactions