php - laravel - controller returns different array -


i need return array, but, when send id 2 or more results, return array this

enter image description here

but need, return's in format

enter image description here

my code this

<?php  namespace roconline\http\controllers;  use illuminate\http\request; use roconline\equipment;  class equipmentcontroller extends controller { private $modelequipment; private $alllistactive;  public function __construct(equipment $equipment) {     $this->middleware('auth');     $this->modelequipment = $equipment;     $this->alllistactive = $this->modelequipment->all();  }  public function listall() {     return $this->alllistactive; }  public function byclientid($id){     return $this->alllistactive->where('idclient', $id)->toarray(); } } 


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -