<?php

namespace App\Http\Controllers;
use App\Models\Dispositivo;
use Illuminate\Http\Request;
use App\Model\User;
use DataTables;
class UserController extends Controller
{
    function showdevices (Request $request){

        // if ($request->ajax()) {
        //     $data = Dispositivo::get();
        //     return DataTables::of($data)
        //             ->addIndexColumn()
        //             ->addColumn('cityName', function($row){
        //                 $btn = '<a href="javascript:void(0)" class="edit btn btn-primary btn-sm">View</a>';
        //                 return $btn;
        //             })

        //             ->make(true);
        // }

        return view('usuarios.devices.dashboard1');
    }
    function showusers (Request $request){
        return DataTables::of(Dispositivo::where('estado','permitido')->get())->addIndexColumn()
            ->addColumn('Mais', function($row){
                            $btn = '<a href="javascript:void(0)" class="edit btn btn-primary btn-sm">View</a>';
                            return $btn;
                        })->make(true);
    }
}
