vendredi 9 décembre 2016

How to set hidden attributes to an Controller method in Laravel5.0?

I want to hide some data which selected from database but reinitialize from some method in Controller not defined in its Models.

function ddd(){
        return Client::select($this->_client)->with([
            'Contact'=>function($s){
                //$this->setHidden('use_id');
                //$s->setHidden('use_id');
                $s->select($this->_contact);
            },
            'Employer'=>function($s){$s->select($this->_employers);},
        ])->get();
    }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire