return [
// ...
/*
|--------------------------------------------------------------------------
| Firebase Settings section
|--------------------------------------------------------------------------
|
| Here you may specify some configs for FCM.
|
*/
'fcm' => [
/*
|----------------------------------------------------------------------
| Firebase service driver
|----------------------------------------------------------------------
|
| Value `file` or `config`:
| - Select `file` option to make service read json file
| - Select `config` option to set up all section in config file
|
*/
'driver' => env('FCM_DRIVER', 'config'),
/*
|---------------------------------------------------------------------
| FCM Drivers
|---------------------------------------------------------------------
|
| Here are each of the firebase.
|
*/
'drivers' => [
'file' => [
'path' => env('FCM_FILE_PATH', base_path('storage/fcm.json')),
],
'config' => [
/*
|------------------------------------------------------------
| Credentials
|------------------------------------------------------------
|
| Content of `firebase.json` file in config. Using if
| `fcm.driver` is `config`. All fields
use Illuminate\Notifications\Notification;
use AvtoDev\FirebaseNotificationsChannel\FcmChannel;
use AvtoDev\FirebaseNotificationsChannel\FcmMessage;
class AccountApproved extends Notification
{
public function via($notifiable)
{
return [FcmChannel::class];
}
public function toFcm($notifiable, $notification)
{
return (new FcmMessage)
->setTitle('Approved!')
->setBody('Your account was approved!');
}
}
use Illuminate\Notifications\Notifiable;
use AvtoDev\FirebaseNotificationsChannel\Receivers\FcmDeviceReceiver;
use AvtoDev\FirebaseNotificationsChannel\Receivers\FcmNotificationReceiverInterface;
class SomeNotifible
{
use Notifiable;
/**
* Reveiver of firebase notification.
*
* @return FcmNotificationReceiverInterface
*/
public function routeNotificationForFcm(): FcmNotificationReceiverInterface
{
return new FcmDeviceReceiver('firebase_token');
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.