Hi Pushkar.
You could use the raw method of the DB class to do that.
$result = Model::find(1)
->select('column1', 'column2', DB:raw('yourFunction(id) as alias'))
->where('column3', '>', 100)
->get();
Its not working ,
I have try to run it like this
->select("tw.*","tt.first_name","tt.last_name",DB:raw('time_format("tw.time","%r") as smstime'))
then php shows error
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community