mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
Activity Log
This commit is contained in:
@@ -6,14 +6,13 @@ use Filament\Support\Enums\Width;
|
||||
use Filament\Tables\Enums\FiltersLayout;
|
||||
use Closure;
|
||||
use Filament\Resources\Pages\ManageRecords;
|
||||
use Filament\Tables\Filters\Layout;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PageListSingle extends ManageRecords
|
||||
{
|
||||
protected Width|string|null $maxContentWidth = 'full';
|
||||
|
||||
protected function getTableFiltersLayout(): ?string
|
||||
protected function getTableFiltersLayout(): FiltersLayout
|
||||
{
|
||||
return FiltersLayout::AboveContent;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\System\ActivityLogs;
|
||||
|
||||
use App\Filament\Resources\System\ActivityLogs\Pages\ManageActivityLogs;
|
||||
use BackedEnum;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Actions\ViewAction;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Enums\FiltersLayout;
|
||||
use Filament\Tables\Filters\Filter;
|
||||
use Filament\Tables\Filters\QueryBuilder;
|
||||
use Filament\Tables\Filters\QueryBuilder\Constraints\DateConstraint;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Spatie\Activitylog\Models\Activity;
|
||||
use UnitEnum;
|
||||
|
||||
class ActivityLogResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Activity::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
||||
|
||||
protected static string | UnitEnum | null $navigationGroup = 'System';
|
||||
|
||||
protected static ?int $navigationSort = 99;
|
||||
|
||||
public static function getNavigationLabel(): string
|
||||
{
|
||||
return __('admin.sidebar.activity_logs');
|
||||
}
|
||||
|
||||
public static function getBreadcrumb(): string
|
||||
{
|
||||
return self::getNavigationLabel();
|
||||
}
|
||||
|
||||
public static function getLabel(): ?string
|
||||
{
|
||||
return self::getNavigationLabel();
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
//
|
||||
]);
|
||||
}
|
||||
|
||||
public static function infolist(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
//
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
// subject 是被操作的对象,也是一个关联关系
|
||||
TextColumn::make('subject_type')
|
||||
->label(__("activity-log.subject_type"))
|
||||
,
|
||||
|
||||
TextColumn::make('subject_id')
|
||||
->label(__("activity-log.subject_id"))
|
||||
,
|
||||
|
||||
TextColumn::make('description')
|
||||
->label(__('label.description'))
|
||||
,
|
||||
|
||||
// causer 是操作者,一个关联关系
|
||||
TextColumn::make('causer.username')
|
||||
->label(__('label.operator'))
|
||||
,
|
||||
|
||||
TextColumn::make('created_at')
|
||||
->label(__('label.created_at'))
|
||||
,
|
||||
])
|
||||
->defaultSort('id', 'desc')
|
||||
->filters([
|
||||
Filter::make('created_at_begin')
|
||||
->schema([
|
||||
DateTimePicker::make('created_at_begin')->label(__('label.created_at_begin')),
|
||||
])
|
||||
->query(function (Builder $query, array $data) {
|
||||
return $query
|
||||
->when(
|
||||
$data['created_at_begin'],
|
||||
fn (Builder $query, $value): Builder => $query->where('created_at', '>=', $value),
|
||||
);
|
||||
}),
|
||||
Filter::make('created_at_end')
|
||||
->schema([
|
||||
DateTimePicker::make('created_at_end')->label(__('label.created_at_end')),
|
||||
])
|
||||
->query(function (Builder $query, array $data) {
|
||||
return $query
|
||||
->when(
|
||||
$data['created_at_end'],
|
||||
fn (Builder $query, $value): Builder => $query->where('created_at', '<=', $value),
|
||||
);
|
||||
}),
|
||||
Filter::make('operator')
|
||||
->schema([
|
||||
TextInput::make('operator')->label(__('label.operator')),
|
||||
])
|
||||
->query(function (Builder $query, array $data) {
|
||||
return $query
|
||||
->when(
|
||||
$data['operator'],
|
||||
fn (Builder $query, $value): Builder => $query->whereHas('causer', function (Builder $query) use ($value) {
|
||||
$query->where('username', 'like', "%{$value}%");
|
||||
}),
|
||||
);
|
||||
}),
|
||||
])
|
||||
->recordActions([
|
||||
ViewAction::make('view_properties')
|
||||
->label(__("activity-log.view_properties"))
|
||||
->icon('heroicon-o-information-circle')
|
||||
->color('gray')
|
||||
->schema(function ($record) {
|
||||
$fields = [];
|
||||
// 动态地从 JSON 数据创建 TextEntry
|
||||
// 注意:这里需要确保 $record->properties 是一个数组
|
||||
$properties = $record->properties->toArray();
|
||||
foreach ($properties as $key => $value) {
|
||||
// 如果值是数组或对象,美化输出
|
||||
if (is_array($value) || is_object($value)) {
|
||||
$value = json_encode($value, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
|
||||
$fields[] = TextEntry::make($key)->html()->getStateUsing(fn() => "<pre><code>$value</code></pre>");
|
||||
} else {
|
||||
$fields[] = TextEntry::make($key)->label(ucfirst($key));
|
||||
}
|
||||
}
|
||||
return $fields;
|
||||
})
|
||||
->action(null), // 无需执行任何操作
|
||||
DeleteAction::make(),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ManageActivityLogs::route('/'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\System\ActivityLogs\Pages;
|
||||
|
||||
use App\Filament\PageListSingle;
|
||||
use App\Filament\Resources\System\ActivityLogs\ActivityLogResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ManageRecords;
|
||||
|
||||
class ManageActivityLogs extends PageListSingle
|
||||
{
|
||||
protected static string $resource = ActivityLogResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -3,9 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\ModelEventEnum;
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class AgentAllow extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $table = 'agent_allowed_family';
|
||||
|
||||
protected $fillable = [
|
||||
|
||||
@@ -3,9 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\ModelEventEnum;
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class AgentDeny extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $table = 'agent_allowed_exception';
|
||||
|
||||
protected $fillable = [
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class AudioCodec extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $table = 'audiocodecs';
|
||||
|
||||
protected $fillable = ['name', 'sort_index', 'mode',];
|
||||
|
||||
+3
-1
@@ -2,7 +2,9 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class Avp extends NexusModel
|
||||
{
|
||||
|
||||
use NexusActivityLogTrait;
|
||||
}
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class Category extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $table = 'categories';
|
||||
|
||||
protected $fillable = ['mode', 'name', 'class_name', 'image', 'sort_index', 'icon_id'];
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class Codec extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $table = 'codecs';
|
||||
|
||||
protected $fillable = ['name', 'sort_index', 'mode',];
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class DownloadSpeed extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $table = 'downloadspeed';
|
||||
|
||||
protected $fillable = ['name'];
|
||||
|
||||
+3
-1
@@ -2,13 +2,15 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
use Carbon\Carbon;
|
||||
use Google\Service\Dataproc\RegexValidation;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Exam extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $fillable = [
|
||||
'name', 'description', 'begin', 'end', 'duration', 'status', 'is_discovered', 'filters', 'indexes', 'priority',
|
||||
'recurring', 'type', 'success_reward_bonus', 'fail_deduct_bonus', 'max_user_count', 'background_color',
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
use App\Repositories\ExamRepository;
|
||||
|
||||
class ExamUser extends NexusModel
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class Icon extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $table = 'caticons';
|
||||
|
||||
protected $fillable = ['name', 'folder', 'cssfile', 'multilang', 'secondicon', 'designer', 'comment'];
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class Isp extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $table = 'isp';
|
||||
|
||||
protected $fillable = ['name'];
|
||||
|
||||
@@ -2,10 +2,13 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class Medal extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
const GET_TYPE_EXCHANGE = 1;
|
||||
|
||||
const GET_TYPE_GRANT = 2;
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class Media extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $table = 'media';
|
||||
|
||||
protected $fillable = ['name', 'sort_index', 'mode',];
|
||||
|
||||
@@ -3,10 +3,13 @@
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\MessageTemplateNameEnum;
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class MessageTemplate extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $fillable = ['name', 'content', 'language_id'];
|
||||
|
||||
public $timestamps = true;
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class News extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $table = 'news';
|
||||
|
||||
protected $fillable = [
|
||||
|
||||
@@ -2,11 +2,14 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
use Illuminate\Support\Str;
|
||||
use Laravel\Passport\Client;
|
||||
|
||||
class OauthClient extends Client
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::creating(function (OauthClient $model) {
|
||||
|
||||
@@ -2,12 +2,15 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
use Laravel\Passport\Client;
|
||||
use Nexus\Database\NexusDB;
|
||||
use Ramsey\Uuid;
|
||||
|
||||
class OauthProvider extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $fillable = [
|
||||
'uuid', 'name', 'client_id', 'client_secret', 'authorization_endpoint_url', 'token_endpoint_url',
|
||||
'user_info_endpoint_url', 'id_claim', 'username_claim', 'email_claim', 'enabled', 'priority',
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class Poll extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $fillable = ['added', 'question', 'option0', 'option1', 'option2', 'option3', 'option4', 'option5'];
|
||||
|
||||
protected $casts = [
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class PollAnswer extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $table = 'pollanswers';
|
||||
|
||||
protected $fillable = ['pollid', 'userid', 'selection',];
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class Processing extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $table = 'processings';
|
||||
|
||||
protected $fillable = ['name', 'sort_index', 'mode',];
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
use App\Auth\Permission;
|
||||
use App\Http\Middleware\Locale;
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
use App\Repositories\TagRepository;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
@@ -12,6 +13,8 @@ use Nexus\Database\NexusDB;
|
||||
|
||||
class SearchBox extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
private static array $instances = [];
|
||||
|
||||
private static array $modeOptions = [];
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class SecondIcon extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $table = 'secondicons';
|
||||
|
||||
protected $fillable = [
|
||||
|
||||
@@ -5,12 +5,15 @@ namespace App\Models;
|
||||
use App\Enums\SeedBoxRecord\IpAsnEnum;
|
||||
use App\Enums\SeedBoxRecord\IsAllowedEnum;
|
||||
use App\Enums\SeedBoxRecord\TypeEnum;
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
use App\Repositories\SeedBoxRepository;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Nexus\Database\NexusDB;
|
||||
|
||||
class SeedBoxRecord extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $fillable = ['type', 'uid', 'status', 'operator', 'bandwidth', 'ip', 'ip_begin', 'ip_end', 'ip_begin_numeric', 'ip_end_numeric',
|
||||
'comment', 'version', 'is_allowed', 'asn'
|
||||
];
|
||||
|
||||
@@ -2,11 +2,14 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
use Illuminate\Support\Arr;
|
||||
use Nexus\Database\NexusDB;
|
||||
|
||||
class Setting extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $fillable = ['name', 'value', 'autoload'];
|
||||
|
||||
public $timestamps = true;
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class Source extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $fillable = ['name', 'sort_index', 'mode',];
|
||||
|
||||
public static function getLabelName()
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class Standard extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $fillable = ['name', 'sort_index', 'mode',];
|
||||
|
||||
public static function getLabelName()
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class Tag extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
public $timestamps = true;
|
||||
|
||||
protected $fillable = [
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class Team extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $fillable = ['name', 'sort_index', 'mode',];
|
||||
|
||||
public static function getLabelName()
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class Topic extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $fillable = ['userid', 'subject', 'locked', 'forumid', 'firstpost', 'lastpost', 'sticky', 'hlcolor', 'views'];
|
||||
|
||||
public function user()
|
||||
|
||||
@@ -2,10 +2,13 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
use Nexus\Database\NexusDB;
|
||||
|
||||
class TorrentDenyReason extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $table = 'torrent_deny_reasons';
|
||||
|
||||
public $timestamps = true;
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class TorrentState extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $fillable = ['global_sp_state', 'deadline', 'begin'];
|
||||
|
||||
protected $table = 'torrents_state';
|
||||
|
||||
@@ -2,10 +2,13 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
use Nexus\Database\NexusDB;
|
||||
|
||||
class TrackerUrl extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $fillable = ['url', 'enabled', 'is_default', 'priority'];
|
||||
|
||||
public $timestamps = true;
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Traits;
|
||||
|
||||
use Spatie\Activitylog\LogOptions;
|
||||
use Spatie\Activitylog\Traits\LogsActivity;
|
||||
|
||||
trait NexusActivityLogTrait
|
||||
{
|
||||
use LogsActivity;
|
||||
public function getActivitylogOptions(): LogOptions
|
||||
{
|
||||
return LogOptions::defaults()
|
||||
->logOnlyDirty()
|
||||
->dontSubmitEmptyLogs()
|
||||
->logAll();
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class UploadSpeed extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $table = 'uploadspeed';
|
||||
|
||||
protected $fillable = ['name'];
|
||||
|
||||
+2
-4
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
use App\Exceptions\NexusException;
|
||||
use App\Http\Middleware\Locale;
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
use App\Repositories\ExamRepository;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
@@ -23,7 +24,7 @@ use NexusPlugin\Permission\Models\UserPermission;
|
||||
|
||||
class User extends Authenticatable implements FilamentUser, HasName
|
||||
{
|
||||
use HasFactory, Notifiable, HasApiTokens;
|
||||
use HasFactory, Notifiable, HasApiTokens, NexusActivityLogTrait;
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
@@ -633,7 +634,4 @@ class User extends Authenticatable implements FilamentUser, HasName
|
||||
&& $this->accessToken && $this->accessToken->can($ability);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Traits\NexusActivityLogTrait;
|
||||
|
||||
class UserMeta extends NexusModel
|
||||
{
|
||||
use NexusActivityLogTrait;
|
||||
|
||||
protected $fillable = ['uid', 'meta_key', 'meta_value', 'status', 'deadline'];
|
||||
|
||||
public $timestamps = true;
|
||||
|
||||
Reference in New Issue
Block a user