Added account status badges
This commit is contained in:
parent
3c0e33fef7
commit
1afd420d25
31
app/View/Components/AccountStatus.php
Normal file
31
app/View/Components/AccountStatus.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components;
|
||||
|
||||
use App\User;
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class AccountStatus extends Component
|
||||
{
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($userId)
|
||||
{
|
||||
$this->user = User::findOrFail($userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|\Closure|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.account-status');
|
||||
}
|
||||
}
|
15
resources/views/components/account-status.blade.php
Normal file
15
resources/views/components/account-status.blade.php
Normal file
@ -0,0 +1,15 @@
|
||||
<span>
|
||||
|
||||
@if ($user->isBanned())
|
||||
<span class="badge badge-danger"><i class="fa fa-ban"></i> {{__('Suspended')}}</span>
|
||||
@else
|
||||
<span class="badge badge-success">{{__('Active')}}</span>
|
||||
@endif
|
||||
|
||||
@if(!is_null($user->email_verified_at))
|
||||
<span class="badge badge-success"><i class="fas fa-check-square"> </i> {{ __('Verified Email') }}</span>
|
||||
@else
|
||||
<span class="badge badge-danger"><i class="fas fa-exclamation-circle"></i> {{ __('Unverified Email') }}</span>
|
||||
@endif
|
||||
|
||||
</span>
|
@ -131,11 +131,7 @@
|
||||
<td>{{$user->name}}</td>
|
||||
<td>{{ $user->email }}</td>
|
||||
<td>
|
||||
@if ($user->isBanned())
|
||||
<span class="badge badge-danger"><i class="fa fa-ban"></i> {{__('messages.players.banned')}}</span>
|
||||
@else
|
||||
<span class="badge badge-success">{{__('messages.players.active')}}</span>
|
||||
@endif
|
||||
<x-account-status user-id="{{ $user->id }}"></x-account-status>
|
||||
</td>
|
||||
<td>{{$user->created_at}}</td>
|
||||
<td>
|
||||
|
@ -68,7 +68,9 @@
|
||||
@endforeach
|
||||
</td>
|
||||
<td>{{ $user->email }}</td>
|
||||
<td><span class="badge badge-success">{{__('messages.players.active')}}</span></td>
|
||||
<td>
|
||||
<x-account-status user-id="{{ $user->id }}"></x-account-status>
|
||||
</td>
|
||||
<td>{{$user->created_at}}</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-sm btn-success mr-2" onclick="window.location.href='{{route('showSingleProfile', ['user' => $user->id])}}'"><i class="fa fa-eye"></i></button>
|
||||
|
Loading…
x
Reference in New Issue
Block a user