-
Notifications
You must be signed in to change notification settings - Fork 86
Installation and Configuration
Add it on your composer.json
"fenos/notifynder": "3.*"
and run composer update
Add the following string to config/app.php
Providers array:
'Fenos\Notifynder\NotifynderServiceProvider'
in 5.1:
Fenos\Notifynder\NotifynderServiceProvider::class
Aliases array:
'Notifynder' => 'Fenos\Notifynder\Facades\Notifynder'
in 5.1:
'Notifynder' => Fenos\Notifynder\Facades\Notifynder::class
Publish the migration as well as the configuration of notifynder with the following command:
php artisan vendor:publish --provider="Fenos\Notifynder\NotifynderServiceProvider"
Don't forget to migrate.
Let's see which configuration we have available. Opening the file config/notifynder.php
file
We can start from the first configuration:
#####- model#####
Note: if you are going to use Notifynder as polymoprhic you can jump this option. This option allow you to use a different model from the default User
model. If your model has a different
name or is in a different namespace reference it here.
#####- polymorphic#####
This option allow you to use Notifynder as a multiple model relations (Polymorphic) that means if you want
to notify different Model entities
swap this value to true.
#####- notification_model#####
This option allow you to extend the default Notification
model provided from Notifynder. Just create
your custom Notification
Model, extend it with Fenos\Notifynder\Models\Notification
and reference your custom Model
to this option.
#####- translations##### This option is the container of your notifications translations. If you wish to have a multi language notification system add your translation to this option with the following syntax:
[
// language
'it' => [
// name of category
'name.category' => 'text to {parse value} translate' // translation
]
]
Tip: if you want to keep your translations in an different file then just create a new file returning an array of translations and use the
require('filename.php')
as value of this option