PHP code example of orlyapps / laravel-firebase-notifications

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

    

orlyapps / laravel-firebase-notifications example snippets


// User.php
class User extends Authenticatable
{
    use Notifiable, HasPushTokens;
}

// services.php
'fcm' => [
    'json_file_path' => storage_path('xxxxx-annxd-xxxx.json'),
]

// api.php
LaravelFirebaseNotifications::routes();

 \App\User::find(1)->notify(new TextNotification('test', 'body', 'https://orlyapps.de'));