Bug description
I have a simple NavItem in my CP that just calls the route: the route does something, sends a "success" toast, and returns:
publicfunction__invoke()
{
// do some things
Toast::success('Success!');
return Inertia::back();
}However, a JS error is thrown, and an empty array is send back as the Toast, resulting in the console error:
Uncaught TypeError: this[type] is not a function
The props for _toasts looks like:
How to reproduce
- Create a new Statamic site
- Create a simple CP controller (Controller file, and the route), and use the
__invoke method above - Add a Nav item via the AddonServiceProvider
- Visit the route in the CP
Logs
Environment
EnvironmentLaravel Version: 13.14.0PHP Version: 8.4.22Composer Version: 2.9.5Environment: localDebug Mode: ENABLEDMaintenance Mode: OFFTimezone: UTCLocale: enCacheConfig: NOT CACHEDEvents: NOT CACHEDRoutes: NOT CACHEDViews: CACHEDDriversBroadcasting: logCache: fileDatabase: sqliteLogs: stack / singleMail: logQueue: syncSession: fileStoragepublic/storage: NOT LINKEDLivewireLivewire: v4.3.1StatamicAddons: 0License Key: Not setSites: 1Stache Watcher: Enabled (auto)Static Caching: DisabledVersion: 6.20.2 PRO
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
Bug description
I have a simple NavItem in my CP that just calls the route: the route does something, sends a "success" toast, and returns:
However, a JS error is thrown, and an empty array is send back as the Toast, resulting in the console error:
The props for
_toastslooks like:How to reproduce
__invokemethod aboveLogs
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response