1. Go to this page and download the library: Download jawabapp/cloud-messaging 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/ */
jawabapp / cloud-messaging example snippets
use Jawabapp\CloudMessaging\Contracts\TargetAudience;
use Jawabapp\CloudMessaging\Traits\EloquentGetTableNameTrait;
use Jawabapp\CloudMessaging\Traits\HasTargetAudience;
class User extends Authenticatable implements TargetAudience
{
use HasTargetAudience;
use EloquentGetTableNameTrait;
//...
}
use Illuminate\Database\Eloquent\Builder;
class User extends Authenticatable implements TargetAudience
{
public static function targetAudienceForPhoneNumbers(Builder $query, $phone_numbers)
{
//...
}
public static function targetAudienceForOS(Builder $query, $os)
{
//...
}
}
public static function targetAudienceForCountries(Builder $query, $condition, $options, &$joins)
{
if ($condition === 'is_not_in') {
$query->whereNotIn('phone_country', $options);
} else {
$query->whereIn('phone_country', $options);
}
}