Git Product home page Git Product logo

laravel-subscribable-notifications's People

Contributors

asantibanez avatar christopher-law avatar jacobbennett avatar laravel-shift avatar lukebouch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-subscribable-notifications's Issues

Attempt to read property "email" on null when user has been soft deleted

When a user that is subscribed to at least one notification is soft deleted, notifications are still trying to be sent to them but are failing because the contact info no longer exists (soft deleted).

We need to scope the query that get's the list of users to send the notification to.

dispatch method send notification to all user who subscribed

Dispatch method send notification to all subscribed user for specific order, But it should be sent to only subscriber user of that order.

For example:

OrderCreated notification subscribers 3 users, like user_id: 5, 15, 26

Order owner user_id is 26

So OrderCreated::dispatch($order) only should send to 26, Not for all 5, 15 and 26.

config:

'subscribable_notifications' => [
        OrderCreated::class,
        OrderEdited::class,
    ],

OrderCreated Notification:

    public static function subscribableNotificationType(): string
    {
        return 'Order-Created';
    }

Controller function:

   public function sent_email()
    {
        $order = Order::find(Session::get('order_id'));
        $order->setStatusConfirmed();
       // $order->user->notify(new OrderCreated($order));
        OrderCreated::dispatch($order);
        return response()->json(['status' => 'success']);
    }

Delay Notifications

Need to be able to delay the sending of a Notification, and would like it to follow the Laravel api for such use case.

$delay = now()->addMinutes(10);
 
InvoicePaidNotification::dispatch($invoice)->delay($delay);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.