dimanche 28 octobre 2018

Selecting extra data from tables [Laravel]. passing parameters?

In Laravel, Actually, what I wanted to get was I've a function which fetches 4 cols from table

public function getData($id)
    {
        $user = $this->user->select(
            'users.name',
            'users.id',
            'users.email',
            'users.address as  address')
            ->where('users.id', $id)
            ->first();

        return $user;
    }

I've 2 more columns. They are 'enabled, occupation'. I want to fetch that two columns as well calling to the same function getData(). So How can I able to do that? Need Help.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2PXyHoF
via IFTTT

Aucun commentaire:

Enregistrer un commentaire