kiwo123
4 years ago
3521
8
Eloquent

Select specific columns using eloquent orm

Posted 4 years ago by kiwo123

I wonder how I can use eloquent orm to only select specific columns.

Eg my query:

$user = User::where('u_id', '=', $userid)
            ->where('type', '=', 1)
            ->where('is_active', '=', 1)
        -> "only select firstname and lastname"

Please sign in or create an account to participate in this conversation.