Advertisement
Guest User

Untitled

a guest
Apr 21st, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. // query can't be select * from table where
  2. Model::select(DB::raw('query'))->get();
  3.  
  4. Model::select(DB::raw('query'))
  5. ->whereNull('deleted_at')
  6. ->orderBy('id')
  7. ->get();
  8.  
  9. $users = DB::table('users')
  10. ->select(DB::raw('count(*) as user_count, status'))
  11. ->where('status', '<>', 1)
  12. ->groupBy('status')
  13. ->get();
  14.  
  15. $users = DB::select('select * from users where id = ?', array(1));
  16. $users = DB::select( DB::raw("select * from users where username = :username"), array('username' => Input::get("username")));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement