laravel / blog-contest-may-mayhem

242 stars 16 forks source link

Laravel Innovations: Making your own webhook mechanism through notifications #85

Open peterfox opened 6 years ago

peterfox commented 6 years ago

https://medium.com/@SlyFireFox/laravel-innovations-making-your-own-webhook-mechanism-through-notifications-96e75e99a2b1

RemiCollin commented 6 years ago

Interesting use of notifications. What are the advantages of using this approach against a queued job that would call the API ?

peterfox commented 6 years ago

@RemiCollin little to none except it makes a much more clear structure for delivery. It separates the who, what and where into notifiable, notification and channel. You can easily do the same thing with dispatching a job but then if you want to change or expand on that job you'll end up creating another job to sit along side the other. I'm sure there will be a few pros and cons for both ways tbh.

I just know I like using custom Channels to solve a few problems like that.