I need return array, but, when send a id with two or more results, the return array is this
But I need, return's in this format
My code is 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();
}
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire