Eloquent DB::Table RAW Query / WhereNull

PHOTO EMBED

Tue Feb 02 2021 17:39:52 GMT+0000 (Coordinated Universal Time)

Saved by @mvieira #php

$users = DB::table('users')
                 ->select(DB::raw('count(*) as user_count, status'))
                 ->where('status', '<>', 1)
                 ->groupBy('status')
                 ->get();


Model::select(DB::raw('query'))
     ->whereNull('deleted_at')
     ->orderBy('id')
     ->get();
content_copyCOPY

https://stackoverflow.com/questions/22925451/how-can-i-query-raw-via-eloquent/28174112