Since they both have a name
column, MySql doesn't know which to use.
Use the alias because your query doesn't specify which alias to use for the name
column.
You can update your query like
->where('posts.name', 'like', '%' . $query . '%')
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community