You can pull the package via composer
$ composer require Alideveloper49/laravel-spf
$ php artisan vendor:publish --provider="Alideveloper49\Fcm\FcmServiceProvider"
return [
/**
* Set your FCM Server Key
* Change to yours
*/
'server_key' => env('FCM_SERVER_KEY', ''),
];
APP_NAME="Laravel"
# ...
FCM_SERVER_KEY=putYourKeyHere
If You want to send a FCM with just notification parameter, this is an example of usage sending a FCM with only data parameter :
$recipients = [
'clKMv.......',
'GxQQW.......',
];
fcm()
->to($recipients)
->priority('high')
->timeToLive(0)
->data([
'title' => 'Test FCM',
'body' => 'This is a test of FCM',
])
->send();