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
{{ message }}
Repository navigation
once inside Blade component behaving incorrectly
#86
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;
class Number extends Component
{
/** * 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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
All reactions