Skip to content

activity model package record events on model with custom message

Notifications You must be signed in to change notification settings

mfrouh/activity-model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Activity Model

composer require mfrouh/activity-model
php artisan migrate
FIREBASE_CREDENTIALS=firebase-credentials.json
use MFrouh\ActivityModel\Interfaces\ActivityInterface;
use MFrouh\ActivityModel\Traits\ActivityModel;


class Order extends Model implements ActivityInterface
{
    use ActivityModel;

   public function activityChanges(): array
    {
        return [
            'status' => [
                'title_ar'   => '',
                'title_en'   => '',
                'message_ar' => '',
                'message_en' => '',
            ],
        ];
    }

    public function activityDefault(): array
    {
        return [
            'created' => [
                'title_ar'   => '',
                'title_en'   => '',
                'message_ar' => '',
                'message_en' => '',
            ],
            'deleted' => [
                'title_ar'   => '',
                'title_en'   => '',
                'message_ar' => '',
                'message_en' => '',
            ],
            'updated' => [
                'title_ar'   => '',
                'title_en'   => '',
                'message_ar' => '',
                'message_en' => '',
            ],
            'restored' => [
                'title_ar'   => '',
                'title_en'   => '',
                'message_ar' => '',
                'message_en' => '',
            ],
        ];
    }

    public function activityFcmTokens(): array
    {
        return [];
    }

}

1- activityChanges() method take column name messages

2- activityDefault() method take event name messages

3- activityFcmTokens() method take tokens to send fcm notification

About

activity model package record events on model with custom message

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages