Laravel di mana pencarian seperti ruang

$search_term = $request->input('search_term');
$words = explode(' ', $search_term);
$column = 'column_name';
$data = $data->where(function ($q) use ($column, $words) {
          foreach ($words as $key => $value) {
            $q->where($column, 'like', "%{$value}%");
          }
        })->get();
Handsome Horse