mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 16:22:14 +00:00
controller refactoring part 17
This commit is contained in:
@@ -16,7 +16,6 @@ use App\Users\Notifications\ResetPassword;
|
||||
use Domain\Subscriptions\Traits\Subscription;
|
||||
use Laravel\Fortify\TwoFactorAuthenticatable;
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Domain\Traffic\Models\Traffic as TrafficModel;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
@@ -128,38 +127,6 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
return $this->hasOne(UserSettings::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Record user upload filesize
|
||||
*/
|
||||
public function recordUpload(int $file_size): void
|
||||
{
|
||||
$record = TrafficModel::whereYear('created_at', '=', now()->year)
|
||||
->whereMonth('created_at', '=', now()->month)
|
||||
->firstOrCreate([
|
||||
'user_id' => $this->id,
|
||||
]);
|
||||
|
||||
$record->update([
|
||||
'upload' => $record->upload + $file_size,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Record user download filesize
|
||||
*/
|
||||
public function recordDownload(int $file_size): void
|
||||
{
|
||||
$record = TrafficModel::whereYear('created_at', '=', now()->year)
|
||||
->whereMonth('created_at', '=', now()->month)
|
||||
->firstOrCreate([
|
||||
'user_id' => $this->id,
|
||||
]);
|
||||
|
||||
$record->update([
|
||||
'download' => $record->download + $file_size,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user favourites folder
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user