I think it should work like this:
$tags = Tag::where('name', 'LIKE', $query . '%')->select('name', 'value', 'id as tag_id')->get();
The select() method is the wrapper for normal SQL selects where you can choose the column so you can use the AS as an alias like in MySQL.
Thank you ftiersch. I feel like an idiot, I should have realized that.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community