(Add) Graveyard MyRessurections 🆕

- abilty for users to track there graveyard resurrections
This commit is contained in:
HDVinnie
2018-12-14 21:20:13 -05:00
parent 514572a37b
commit 34cbe11671
5 changed files with 149 additions and 0 deletions
+21
View File
@@ -24,6 +24,7 @@ use ZipArchive;
use App\History;
use App\Torrent;
use App\Warning;
use App\Graveyard;
use Carbon\Carbon;
use App\PrivateMessage;
use App\BonTransactions;
@@ -805,4 +806,24 @@ class UserController extends Controller
return back()->with($this->toastr->error('Something Went Wrong!', 'Whoops!', ['options']));
}
}
/**
* Get A Users Graveyard Resurrections
*
* @param $username
* @param $id
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function myResurrections($username, $id)
{
$user = User::findOrFail($id);
abort_unless(auth()->user()->group->is_modo || auth()->user()->id == $user->id, 403);
$resurrections = Graveyard::with(['torrent', 'user'])->where('user_id', '=', $user->id)->paginate(25);
return view('user.resurrections', [
'user' => $user,
'resurrections' => $resurrections,
]);
}
}