Datatable search on sql formatted number

  datatable, laravel

i want to make my select format sql data searchable on datatable but i dont know how to put it. if its just normal column, we can just put the column name on datatable "name:" operation. but this one is a generated column. thanks in advance

 $query = Requests::select([
            ' as id',
            'requests.current_status as current_status',
            'requests.updated_at as submitted_at',
            'requests.next_reviewer_role as next_reviewer_role',
            ' as user_name',
            ' as role_name',
            DB::raw('REPLACE(FORMAT(bs.partner_revenue_after_debt, 1), "," , ".") as formatted_share')

the last line is what i’m talking about, i still dont know how to search based on it. thanks again

Source: Laravel

Leave a Reply