(Update) Controller + Commands Query Syntax

- using shorter and more readable syntax
- remove “=“ in where clauses
- uses oldest() / latest() instead of like orderBy('created_at', 'DESC')
This commit is contained in:
HDVinnie
2018-03-24 16:42:59 -04:00
parent e3e21896e2
commit 32e8b1c62b
38 changed files with 219 additions and 219 deletions
@@ -25,7 +25,7 @@ class WarningController extends Controller
public function getWarnings()
{
$warnings = Warning::with(['torrenttitle', 'warneduser'])->latest()->paginate(25);
$warningcount = Warning::where('active', '=', 1)->count();
$warningcount = Warning::where('active', 1)->count();
return view('Staff.warnings.index', ['warnings' => $warnings, 'warningcount' => $warningcount]);
}