How can I get the current user account selected in MetaMask with Web3 js?

I’m using the next function to get the first account from user’s MetaMask: var account = web3.eth.getAccounts((error,result) => { if (error) { console.log(error); } else { return result[0]; } }); However the user could have selected any other account from his MM not just the first one, or switch the account anytime. How to get…

Details

Laravel api resources and LengthAwarePaginator issue

I’m making an API using Eloquent: API Resources. This is my article Resource: class Article extends JsonResource { /** * Transform the resource into an array. * * @param \Illuminate\Http\Request $request * @return array */ public function toArray($request) { return [ ‘id’ => $this->id, ‘slug’ => $this->slug, ‘name’ => $this->name, ‘comments’ => $this->when($this->showComments(), function ()…

Details

Unable to detect wifi networks in xbuntu (already tried every solution proposed on askubuntu)

The wifi was working. I closed my laptop. I opened my laptop. The wifi wasn’t working anymore, specifically no wifi is found. I tried restarting the network manager, rebooting the PC, trying every solution found on the web, nothing. All the information about my system are here https://pastebin.com/jNP35arP . The info are generated by running…

Details