mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-11 01:24:46 +02:00
feat: action logs (#702)
This commit is contained in:
@@ -7,10 +7,12 @@ namespace App\Models;
|
||||
use App\Contracts\Models\Nameable;
|
||||
use App\Contracts\Models\HasSubtitle;
|
||||
use App\Enums\Http\Api\Filter\ComparisonOperator;
|
||||
use App\Models\Admin\ActionLog;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Prunable;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
@@ -100,4 +102,14 @@ abstract class BaseModel extends Model implements Nameable, HasSubtitle
|
||||
now()->subWeek()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the action logs for the model.
|
||||
*
|
||||
* @return MorphMany
|
||||
*/
|
||||
public function action_logs(): MorphMany
|
||||
{
|
||||
return $this->morphMany(ActionLog::class, 'actionable');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user