Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mfrouh/activity-model
activity model package record events on model with custom message
https://github.com/mfrouh/activity-model
Last synced: about 1 month ago
JSON representation
activity model package record events on model with custom message
- Host: GitHub
- URL: https://github.com/mfrouh/activity-model
- Owner: mfrouh
- Created: 2022-09-29T21:23:46.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-30T14:09:50.000Z (4 months ago)
- Last Synced: 2024-11-06T23:13:08.738Z (about 2 months ago)
- Language: PHP
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Activity Model
```composer
composer require mfrouh/activity-model
``````bash
php artisan migrate
``````env
FIREBASE_CREDENTIALS=firebase-credentials.json
``````php
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**