Support the ongoing development of Laravel.io →
Blade Artisan Authorization
Last updated by @ajax30 4 months ago.
0

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!

Full Stack Europe

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?

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

© 2022 Laravel.io - All rights reserved.