PHP code example of kz370 / laravel-firebase-notifications
1. Go to this page and download the library: Download kz370/laravel-firebase-notifications library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kz370 / laravel-firebase-notifications example snippets
use Kz370\FirebaseNotifications\Jobs\FirebaseNotificationJob;
FirebaseNotificationJob::dispatch(
$deviceToken,
'Queued Message',
'This notification is sent via the queue!'
);
FirebaseNotificationJob::dispatch(
null,
'Breaking News',
'Something big just happened!',
null,
['category' => 'news'],
true // Indicates it's for a topic
);