Use whereHas (or in this case orWhereHas) to constrain the query using the relationships:
$discover = Discover::with(['category','subcategory'])
->where('status','1')
->where(function ($builder) use ($searchString) {
$builder->where('name','like',"%{$searchString}%")
->orWhere('description','like',"%{$searchString}%")
->orWhereHas('category', fn ($builder) => $builder->where('name','like',"%{$searchString}%"))
->orWhereHas('subcategory', fn ($builder) => $builder->where('name','like',"%{$searchString}%"));
})
->orderBy('created_at', 'DESC')
->get()
->toArray();
Note I assumed both categories and subcategories table each have a name column that you want to filter on - change as appropriate. Also logical grouping of the OR constraints is necessary!