问题
I used this "mobiledetect/mobiledetectlib": "^2.8" pkg of laravel for device detection and want to print the userAgent value.I call this method
$this->device = new MobileDetect();
dd($this->device)
After that i got this result:
now i want to print userAgent value. I have tried these code but not working.
dd($this->device->userAgent,$this->device["userAgent"]);
回答1:
I was also facing this issue a few days ago. I have a solution for it you can try.
$this->device->getUserAgent();
I was facing the same issue for access the #fillable values in the Model
dd(User::get()[0]->getFillable(),User::get()[0]);
来源:https://stackoverflow.com/questions/62213847/how-to-get-access-the-values-of-object-which-are-starting-from-in-laravel-dd