PHP code example of tomatophp / filament-fcm

1. Go to this page and download the library: Download tomatophp/filament-fcm 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/ */

    

tomatophp / filament-fcm example snippets


->plugin(\TomatoPHP\FilamentFcm\FilamentFcmPlugin::make()
)

use Filament\Notifications\Notification;

Notification::make('send')
    ->title('Test Notifications')
    ->body('This is a test notification')
    ->icon('heroicon-o-bell')
    ->color('success')
    ->actions([
    \Filament\Notifications\Actions\Action::make('view')
        ->label('View')
        ->url('https://google.com')
        ->markAsRead()
    ])
    ->sendToFCM(auth()->user())
bash
php artisan config:clear
bash
php artisan filament-fcm:install
bash
php artisan vendor:publish --tag="filament-fcm-config"
bash
php artisan vendor:publish --tag="filament-fcm-views"
bash
php artisan vendor:publish --tag="filament-fcm-migrations"