php - laravel - controller returns different array -
i need return array, but, when send id 2 or more results, return array this
but need, return's in format
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
Post a Comment