Skip to content

Latest commit

 

History

History
79 lines (65 loc) · 1.7 KB

README.md

File metadata and controls

79 lines (65 loc) · 1.7 KB

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