mirror of
https://github.com/Deathgarden-Rebirth/Deathgarden_Rebirth-Rewrite.git
synced 2026-09-08 19:25:10 -05:00
Fixed a duplicate file.
This commit is contained in:
4
dist/app/View/Components/Misc/BanStatus.php
vendored
4
dist/app/View/Components/Misc/BanStatus.php
vendored
@@ -24,8 +24,8 @@ public function __construct(public User $user)
|
||||
}
|
||||
|
||||
$banCheckQuery = $user->bans()
|
||||
->whereDate('start_date', '<', Carbon::now())
|
||||
->whereDate('end_date', '>', Carbon::now());
|
||||
->whereDate('start_date', '<', Carbon::now()->toDateTimeString())
|
||||
->whereDate('end_date', '>', Carbon::now()->toDateTimeString());
|
||||
|
||||
if ($banCheckQuery->exists())
|
||||
$this->banStatus = BanStatusEnum::Banned;
|
||||
|
||||
43
dist/app/View/Components/Misc/banStatus.php
vendored
43
dist/app/View/Components/Misc/banStatus.php
vendored
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Misc;
|
||||
|
||||
use App\Enums\Api\Ban\BanStatus as BanStatusEnum;
|
||||
use App\Models\User\User;
|
||||
use Closure;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class BanStatus extends Component
|
||||
{
|
||||
public BanStatusEnum $banStatus;
|
||||
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*/
|
||||
public function __construct(public User $user)
|
||||
{
|
||||
if(!$user->bans()->exists()) {
|
||||
$this->banStatus = BanStatusEnum::Good;
|
||||
return;
|
||||
}
|
||||
|
||||
$banCheckQuery = $user->bans()
|
||||
->whereDate('start_date', '<', Carbon::now()->toDateTimeString())
|
||||
->whereDate('end_date', '>', Carbon::now()->toDateTimeString());
|
||||
|
||||
if ($banCheckQuery->exists())
|
||||
$this->banStatus = BanStatusEnum::Banned;
|
||||
else
|
||||
$this->banStatus = BanStatusEnum::Warning;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*/
|
||||
public function render(): View|Closure|string
|
||||
{
|
||||
return view('components.misc.ban-status');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user