Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Push notification without using model #21

Closed
AzrizHaziq opened this issue Nov 22, 2016 · 1 comment
Closed

Push notification without using model #21

AzrizHaziq opened this issue Nov 22, 2016 · 1 comment

Comments

@AzrizHaziq
Copy link

Hello again, it is possible to send notification without using model. And how to do it?

Because my case will be like this, Note: OTP = One-Time-Password

1)After user fill in all the credentials
-I'm not sending all credentials to server,
-Just send device_token to server to initiate OTP.
2)The system will send OTP to this particular user.
3)User then send PIN number with device_token.

So during step 2. How do i push notification without user model. It is possible?

$pushDevice = [
   'device_token' => $request->device_token
];
Notification::send($pushDevice, new OTPPasswordNotification($pinNumber));
@AzrizHaziq
Copy link
Author

Sorry, my bad for not thinking hard.

what i have done is

create another Model class with device_token attribute and then add this to your class

use Illuminate\Notifications\Notifiable;

class ABC extends Model
{
  use Notifiable,
  
  protected $fillable = [
      'device_token'  ];

  protected $table="abc";

  public function routeNotificationForIonicPush(){
    return $this->device_token;
  }

}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant