Simplest way to do this would be to add the fields you need to the get()
method and alias the ones you want to rename there.
Products::where("actice", "=", true)
->joinWithTags
->get(['tags.name AS tag_name', 'products.*'])
->toArray();
More Related Contents:
- Property Property Property [title] does not exist on this collection instance does not exist on this collection instance does not exist on this collection instance
- Automatically deleting related rows in Laravel (Eloquent ORM)
- Get Specific Columns Using “With()” Function in Laravel Eloquent
- How do I get the query builder to output its raw SQL query as a string?
- How to do this in Laravel, subquery where in
- Laravel Eloquent Query Using WHERE with OR AND OR?
- Laravel Check If Related Model Exists
- Laravel update model with unique validation rule for attribute
- How can I convert many statement mysql to laravel eloquent?
- Eloquent ORM Code Hinting in PhpStorm
- Laravel Model with Two Primary Keys update [duplicate]
- Laravel eager loading with limit
- Get the Query Executed in Laravel 3/4
- What does “Mass Assignment” mean in Laravel?
- Laravel OrderBy relationship count
- Laravel Checking If a Record Exists
- Laravel Eloquent: How to order results of related models?
- How to set a default attribute value for a Laravel / Eloquent model?
- Laravel – Database, Table and Column Naming Conventions?
- Order By before Group By using Eloquent (Laravel)
- How to Merge Two Eloquent Collections?
- How to create a subquery using Laravel Eloquent?
- Eloquent model mass update
- Difference between Eloquent\Model::get() and all()
- Laravel 4.1: How to paginate eloquent eager relationship?
- Eloquent many-to-many-to-many – how to load distant relation easily
- Laravel Eloquent: How to get only certain columns from joined tables
- How can I query raw via Eloquent?
- A __construct on an Eloquent Laravel Model
- How to get last insert id in Eloquent ORM laravel