PHP code example of ahmedeid46 / firebase
1. Go to this page and download the library: Download ahmedeid46/firebase 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/ */
ahmedeid46 / firebase example snippets
use Ahmedeid46\Firebase\Notification;
// Resolve the Notification instance from the container
$notification = app(Notification::class);
// Use fluent interface to set properties and send the notification
$response = $notification
->setTokens(['device-token-1', 'device-token-2'])
->setTitle('Test Notification')
->setMessage('This is a test message')
->send();
// Output the response
dd($response);
bash
php artisan vendor:publish --provider="Ahmedeid46\Firebase\NotificationServiceProvider"