(Add) Ban Logs On User Profiles 🆕

This commit is contained in:
HDVinnie
2019-01-12 20:39:36 -05:00
parent 84459b8d1c
commit e405bf4ef1
5 changed files with 114 additions and 4 deletions

View File

@@ -14,6 +14,7 @@
namespace App\Http\Controllers;
use Image;
use App\Ban;
use App\Peer;
use App\User;
use App\Group;
@@ -826,4 +827,25 @@ class UserController extends Controller
'resurrections' => $resurrections,
]);
}
/**
* Get A Users Bans.
*
* @param $username
* @param $id
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function getBans($username, $id)
{
abort_unless(auth()->user()->group->is_modo, 403);
$user = User::findOrFail($id);
$bans = Ban::where('owned_by', '=', $user->id)->latest()->get();
return view('user.banlog', [
'user' => $user,
'bans' => $bans,
]);
}
}