laravel order by raw
snippet in php

laravel order by raw

user1259

$orders = DB::table('orders')
                ->orderByRaw('updated_at - created_at DESC')
                ->get();

laravel query db::raw

user7524

$someVariable = Input::get("some_variable");

$results = DB::select( DB::raw("SELECT * FROM some_table WHERE some_col = '$someVariable'") );