Some Poller page cleanups (#11287)

* Some Poller page cleanups
Some queries loaded all devices into memory and the counted them, we should have sql count them if we only need a count.
Models should be singular
Use named routes for url generation
Try to keep presentation and data collection separated in blade and controller.

* Update PollerController.php

* Fix style

* Fix new PollerGroup references
This commit is contained in:
Tony Murray
2020-03-22 13:29:31 -05:00
committed by GitHub
parent 7e7320139a
commit 43a8616efd
11 changed files with 90 additions and 131 deletions

View File

@@ -2,13 +2,12 @@
namespace App\Http\Controllers;
use App\Models\Device;
use App\Models\PollerGroups;
use App\Models\PollerGroup;
use Illuminate\Http\Request;
class PollerGroupController extends Controller
{
public function destroy(Request $request, PollerGroups $pollergroup)
public function destroy(Request $request, PollerGroup $pollergroup)
{
if ($request->user()->isAdmin()) {
$pollergroup->delete();