title: Laravel - How to use onesignal notification
body: <p>I have a back office developed in laravel that allow to insert data that then android and ios app get.</p>
  
  <p>Now i need to implement onsignal notification for example for when a new product was inserted in back office the app user receives a notification.</p>
  
  <p>I setup my onesignal notification and install in my laravel project this package: <code>https://github.com/laravel-notification-channels/onesignal</code>.
  I set <code>OneSignal App ID</code> and <code>REST API Key</code> too.</p>
  
  <p>After that I create a new controller and put the example code that is in package link.
  Controller:</p>
  
  <pre><code>   use Illuminate\Http\Request;
  use NotificationChannels\OneSignal\OneSignalChannel;
  use NotificationChannels\OneSignal\OneSignalMessage;
  use NotificationChannels\OneSignal\OneSignalWebButton;
  use Illuminate\Notifications\Notification;
  
  class NotificationsController extends Controller
  {
    public function via($notifiable)
    {
        return [OneSignalChannel::class];
    }
  
    public function toOneSignal($notifiable)
    {
        return OneSignalMessage::create()
            -&gt;subject("Your {$notifiable-&gt;service} account was approved!")
            -&gt;body("Click here to see details.")
            -&gt;url('http://onesignal.com')
            -&gt;webButton(
                OneSignalWebButton::create('link-1')
                    -&gt;text('Click here')
                    -&gt;icon('https://upload.wikimedia.org/wikipedia/commons/4/4f/Laravel_logo.png')
                    -&gt;url('http://laravel.com')
            );
    }
  }
  </code></pre>
  
  <p>But now I don't konw how to use it.
  For example, how can I send a notification when a new product was added?
  I need to setup routes?</p>
  
  <p>Let me know if don't explain well my problem.</p>
  
  <p>Thank you</p>