Allow passing a string to all the shorthand stream builder methods instead of only accepting model instances
Fixed
The before and after shorthand were accepting two properties: a model instance, which was used to derive the view and view data to be rendered, and a string target, which would be used as the Turbo Stream target. Now, it only accepts the model, which can either be an Eloquent instance or a string. This was technically a BREAKING CHANGE. However, I'm considering the old behavior a bug since it wasn't meant to be like that. If you're using the before/after shorthand, take a closer look a those changes
When using the auto-broadcasting feature, recently created models would be broadcasted to the model's channel as described in Laravel's channel conventions. However, since the model was recently created, there would be no one listening to such events. Instead, we're defaulting to sending broadcasts of recently created models to be sent to the plural version of the model's basename. So, a model named App\Models\Comment would broadcast recently created models to a comments private channel by default. You can also override this in the $broadcasts property. This won't affect models using the $broadcastsTo property or those that implement the broadcastsTo() method, since those have precedence
Added
Adds documentation about Laravel's url()->previous() issue
Changed
Fixed
before
andafter
shorthand were accepting two properties: a model instance, which was used to derive the view and view data to be rendered, and a string target, which would be used as the Turbo Stream target. Now, it only accepts the model, which can either be an Eloquent instance or a string. This was technically a BREAKING CHANGE. However, I'm considering the old behavior a bug since it wasn't meant to be like that. If you're using the before/after shorthand, take a closer look a those changesApp\Models\Comment
would broadcast recently created models to acomments
private channel by default. You can also override this in the$broadcasts
property. This won't affect models using the$broadcastsTo
property or those that implement thebroadcastsTo()
method, since those have precedenceAdded
url()->previous()
issueclose #73 close #68 close #62