1.3.0
Changelog
- NEW: The shorthand methods for building Turbo Streams all now accept either a model instance or a string as the first parameter to be used to derive the target. Optionally, you may pass a content variable to be rendered inside the Turbo Stream, which can be a string, an View instance, or an instance of a carefully handcrafted
HtmlString
(#74 and docs). - NEW: Documented the issue with Laravel's
url()->previous()
and Turbo Frames (docs) - BC: The channel name generated for a newly created model using the auto-broadcast feature was previously that model's broadcasting channel based on Laravel's conventions. However, no user will ever be listening on that channel (since the model was just created), so we're now defaulting to the basename of the model's class in plural, so if you have a model named
App\Models\Comment
, broadcasts for the newly created models will be sent to a privatecomments
channel by default. You may specify thestream
option in the$broadcasts
property. The existing$broadcastTo
property orbroadcastTo()
methods will have precedence over this (#74). - BC: The
before
andafter
shorthand stream builders were previously accepting a model instance and a target string. Now, the first parameter can be either a model instance of a string which will be used to derive the target of the Turbo Stream. Just like the other shorthand methods, you may also pass a string, a view, or anHtmlString
instance as the second parameter for the content of the Turbo Stream. Without the content, you must specify the view/partial to render inside the Turbo Stream, otherwise an exception will be thrown. I consider this change a fix (#74)
Note: I consider both BC changes fixes, so I'm not tagging a major release. If you're relying on the previous behavior, take a closer look at the documentation and make the changes when you upgrade!