Support the ongoing development of Laravel.io →
Blade Artisan Authorization
Last updated by @ajax30 2 years ago.
0
Solution

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 . '%')
0
Solution selected by @ajax30

@faisalfayazkhan Please help me with this question too. Thanks!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Razvan ajax30 Joined 2 Oct 2021

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.