You've already forked Atomcms-edit
Initial commit
This commit is contained in:
Executable
+40
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\User;
|
||||
|
||||
use App\Models\Concerns\BelongsToUser;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Spatie\Activitylog\LogOptions;
|
||||
use Spatie\Activitylog\Traits\LogsActivity;
|
||||
|
||||
/**
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Ban where($column, $operator = null, $value = null)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Ban orderByDesc($column)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Ban whereIn($column, $values, $boolean = 'and', $not = false)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Ban first($columns = ['*'])
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Ban exists()
|
||||
*/
|
||||
class Ban extends Model
|
||||
{
|
||||
use BelongsToUser;
|
||||
use LogsActivity;
|
||||
|
||||
#[\Override]
|
||||
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'ban_expire', 'type', 'reason'];
|
||||
|
||||
#[\Override]
|
||||
public $timestamps = false;
|
||||
|
||||
public function staff(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_staff_id');
|
||||
}
|
||||
|
||||
public function getActivitylogOptions(): LogOptions
|
||||
{
|
||||
return LogOptions::defaults()
|
||||
->logOnly(['user_id', 'ip', 'ban_expire', 'ban_reason', 'type']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user