This service extends an interface which gets and store all notification in your app to an array and also find and delte a user by its index,
In your project
mkdir app/Repository/NotificationRepository
Copy the notication interface and class
cp NotificationInterface & NotificationRepository to app/Repository/NotificationRepository
you will need to create a notification method on the model you are notifying
namespace App\Models
class Xmodel {
public function notification(){
//
}
}
Then use the register method in the appserviceprovider and bind the NOtification interface and the notification class
php artisan make:notification example_class_to_notify
php artisan migrate
- **THank you **