PHPackages                             patienceman/synca - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. patienceman/synca

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

patienceman/synca
=================

Provide a convenient way to interact with Notifications, including Emails, Dbnotification, and one signal notifications, it just helps your declaration and interaction easier.

v1.0.7(2y ago)32.4kMITPHPPHP ^7.4|^8.0

Since Feb 9Pushed 2y ago1 watchersCompare

[ Source](https://github.com/patiencemanzen/patienceman-synca)[ Packagist](https://packagist.org/packages/patienceman/synca)[ RSS](/packages/patienceman-synca/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (1)Versions (10)Used By (0)

Patienceman 🪴 Notification
==========================

[](#patienceman--notification)

Provide a convenient way to interact with Notifications, including Emails, Dbnotification, and one signal notifications, it just helps your declaration and interaction easier.

Installation
------------

[](#installation)

Install the package doesn't require much requirement except to use the following command in the laravel terminal, and you're good to go.

```
composer require patienceman/synca
```

> Before get started let first create Queue table and Notifications:
>
> ```
> php artisan queue:table
> php artisan notification:table
> php artisan migrate
> ```
>
>
>
> Finally, don't forget to instruct your application to use the database`driver` by updating the `QUEUE_CONNECTION` variable in your application's `env` or any queue drive you use, consider [Laravel queue doc](https://laravel.com/docs/8.x/queues) file:
>
> ```
> QUEUE_CONNECTION=database
> ```

Usage
-----

[](#usage)

To start working with Noptifier, u need to run command 🎉 in your custom directories:

```
php artisan make:notifier EmailNotification
```

so it will create the filter file for you, Just in **Notifiers** directory

```
App\Notifiers
```

But in this doc, we'll be using

> `App\Notifications`

```
namespace App\Notifications;

use Patienceman\Synca\NotifyHandler;

class EmailNotification extends NotifyHandler {
    /**
     * Execute notification actions
     *
     * @return mixed
     */
    public function handle() {
        // do whatever action inside handler
    }
}
```

So you may want even to specify the custom path for your Notifier, Just relax and add it in front of your notifier name. Let's take again our current example.

```
php artisan make:notifier Model/EmailNotification
```

To communicate/use your Notifier, you only need to call Notifier class, Let take a quick example in our CandidateController class to notify about application between creator and seeker

```
namespace App\Http\Controllers;

use App\Notifications\EmailNotification;
use Patienceman\Synca\Facades\Notifier;

class UsersController extends Controller {

    /**
     * Handle User Notifications
     */
    public function notifications(Notifier $notifier) {
        // ... Other Codes

        $notifier->handle([
            EmailNotification::process([
                'message' => 'Application sent to job sent'
            ]),
        ]);
    }

}
```

Now on, we are able send our email notification anytime, any place. So there is many feature comes with notifier, includes

> `->onQueue()`

> `->to($user1, $user2, ....)`

let take a look:

```
namespace App\Http\Controllers;

use App\Notifications\EmailNotification;
use Patienceman\Synca\Facades\Notifier;

class UsersController extends Controller {
    /**
     * Handle User Notifications
     */
    public function notifications(Notifier $notifier, User $user) {
        // ... Other Codes

        $application = Application::findById('1')->belongsToCompany()->user_id;
        $notification = [ 'message' => 'Application sent to job sent' ];

        $users = [
            'user' => $user
            'applicant' => $application
        ];

        $notifier->handle([
            EmailNotification::process($notification)
                ->to($users)
                ->onQueue(),
        ]);
    }

}
```

So to access the passed users you need to just call one by one using indexes: for **example**: with

> ` ->to($users);`

```
$this->user;
$this->applicant;
```

This is so cool, but there might be a time where you need to queue all notifier, not single one like above, let see how: but let support we have also OneSignalNotification:

```
namespace App\Http\Controllers;

use App\Notifications\EmailNotification;
use App\Notifications\OneSignalNotification;
use Patienceman\Synca\Facades\Notifier;

class UsersController extends Controller {

    public function notifications(Notifier $notifier, User $user) {
        $application = Application::findById('1')->belongsToCompany()->user_id;
        $notification = [ 'message' => 'Application sent to job sent' ];

        $users = [
            'user' => $user
            'applicant' => $application
        ];

        $notifier->handle([
            EmailNotification::process($notification)->to($users),
            OneSignalNotification::process($notification)->to([$user]),
        ])->onQueue();
    }

}
```

As u see above, we're working with payloads to notifier, Let see how to get all payload and all targeted user:

```
namespace App\Notifications;

use Patienceman\Synca\NotifyHandler;

class EmailNotification extends NotifyHandler {
    /**
     * Execute notification actions
     * @return mixed
     */
    public function handle() {
        $this->message; // this will get single passed payload
        $this->payload(); // this will get all payload as object
        $this->recipients(); // this will get all targeted users
    }
}
```

There is tile also you want to send notification to all recipients without chose who: by just use function

```
$this->foreachUser()
```

```
$this->foreachUser(fn($user) => $this->sendToDatabase($user));
```

You held this function right!!?, This function can be used in Laravel DBNotification to store custom notification in table: So let see full implementation:

```
namespace App\Notifications;

use Patienceman\Synca\NotifyHandler;

class DatabaseNotification extends NotifyHandler {
    /**
     * Execute notification
     * @return mixed
     */
    public function handle() {
        $this->foreachUser(
            fn($user) => $this->sendToDatabase($user, $this)
        );
    }

    /**
     * Get the array to database representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function toDatabase($notifiable) {
        return $this->payloadAsArray();
    }
}
```

or use customized way:

```
namespace App\Notifications;

use Patienceman\Synca\NotifyHandler;

class DatabaseNotification extends NotifyHandler {
    /**
     * Execute notification
     * @return mixed
     */
    public function handle() {
        $this->foreachUser(function($user) {
            $this->dbNotification($user, fn ($notifiable) => [
                'header' => $this->subject,
                'message' => $this->message,
                'action' => $this->action,
            ]);
        });
    }
}
```

Contributing
------------

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~57 days

Recently: every ~10 days

Total

8

Last Release

791d ago

PHP version history (2 changes)v1.0.0PHP ^8.0

v1.0.2PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/90353f39cc87c27ae67eb7503409539cb8fe8f879fa749cb3e51458cad85c00c?d=identicon)[Manirabona-patience](/maintainers/Manirabona-patience)

---

Top Contributors

[![patiencemanzen](https://avatars.githubusercontent.com/u/55847682?v=4)](https://github.com/patiencemanzen "patiencemanzen (34 commits)")

---

Tags

laravelnotificationspackagephplaravelnotificationnotifierdatabase notification

### Embed Badge

![Health badge](/badges/patienceman-synca/health.svg)

```
[![Health](https://phpackages.com/badges/patienceman-synca/health.svg)](https://phpackages.com/packages/patienceman-synca)
```

###  Alternatives

[ladumor/one-signal

Laravel Wrapper for OneSignal.

125331.3k](/packages/ladumor-one-signal)[oriceon/toastr-5-laravel

Easy toastr notifications for Laravel 5

92473.5k3](/packages/oriceon-toastr-5-laravel)[yieldstudio/laravel-expo-notifier

Easily send Expo notifications with Laravel.

59115.9k](/packages/yieldstudio-laravel-expo-notifier)[helmesvs/laravel-notify

Elegant notifications to laravel with Toastr or PNotify

6127.3k](/packages/helmesvs-laravel-notify)[tomatophp/filament-twilio

Send Whatsapp messages using Twilio and native filament Notification Facade class

112.3k](/packages/tomatophp-filament-twilio)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
