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([
            'requests.id as id',
            'requests.current_status as current_status',
            'requests.updated_at as submitted_at',
            'requests.created_at',
            'requests.next_reviewer_role as next_reviewer_role',
            'users.name as user_name',
            'roles.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