afoysal
1 month ago
187
2
Laravel

Find out values started with certain character from database

Posted 1 month ago by afoysal

I am trying to find out values started with certain character from database using below code. I am using DataTable.

return Datatables::of(Address::where('first_name', 'LIKE', $letter.'%')->get())
->addIndexColumn()
->addColumn('action', function(){
return
'<a href="">
    <i class="fa fa-pencil" aria-hidden="true"></i>
</a>
<a href="">
    <i class="fa fa-trash" aria-hidden="true"></i>
</a>';
})
->rawColumns(['initial','action'])
->make(true);

But my code is not working. I am getting different value than expected value.

Please sign in or create an account to participate in this conversation.