| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentCart\App\Models\Concerns; |
| 4 |
|
| 5 |
use FluentCart\App\Models\Activity; |
| 6 |
use FluentCart\Framework\Database\Orm\Relations\MorphMany; |
| 7 |
|
| 8 |
trait HasActivity |
| 9 |
{ |
| 10 |
public function activities(): MorphMany |
| 11 |
{ |
| 12 |
return $this->morphMany(Activity::class, 'module') |
| 13 |
->orderBy(sanitize_sql_orderby('created_at'), sanitize_sql_orderby('DESC')) |
| 14 |
->orderBy(sanitize_sql_orderby('id'), sanitize_sql_orderby('DESC')); |
| 15 |
} |
| 16 |
} |