z-song / laravel-admin

Build a full-featured administrative interface in ten minutes
https://laravel-admin.org
MIT License
11.15k stars 2.82k forks source link

ErrorException Undefined variable #5847

Open odancer opened 9 months ago

odancer commented 9 months ago

Description:

The code described below, I got ErrorException Undefined variable: devceid . Does anybody have any idea ?

public function getmonitor(Request $request,Content $content)
{
       $deviceid = $request->input('devlist');
       #Log::info('User failed to logint.'.$deviceid);
       return $content
        ->title('設備監控')->row(function (Row $row) {
            $deviceconfig_db = new Deviceconfig();
            $m_rtn = $deviceconfig_db->getData($deviceid);
            foreach($m_rtn as $tmp) {
                 $graphid = $tmp['dev2'].$tmp['dev3'];
                 #Log::info('User failed to logint.'.$graphid);
                 ${"MQTTGW".$tmp['dev1']}= Dashboard::chartjs_monitor1($tmp['dev1'],$graphid,$tmp['dev3'],base64_encode($tmp['dev6']));
                 $row->column(1/4,new Box($tmp['dev2']." ".$tmp['dev7'], ${"MQTTGW".$tmp['dev1']}));
            }
        }); 

}

Steps To Reproduce: