Laravel: customize or extend notifications - database model

前端 未结 5 1404
我在风中等你
我在风中等你 2020-12-03 08:11

IMHO, the current Database channel for saving notifications in Laravel is really bad design:

  • You can\'t use foreign key cascades on items for cleaning up noti
5条回答
  •  被撕碎了的回忆
    2020-12-03 08:55

    Unlike "Bassem El Hachem", I wanted to keep the database keyword in the via() methods.

    So in addition to a custom DatabaseChannel, I also wrote my own ChannelManager that returns my own DatabaseChannel in the createDatabaseDriver() method.

    In my apps' ServiceProvider::register() method, I overwrote the singleton for the original ChannelManager class to return my custom manager.

提交回复
热议问题