INANI El Houssain wrote a nice tutorial on how to append custom values to our Eloquent Model’s results.

laravel tutorial

Today I’m going to show you one of the, let us say, not well known features of Eloquent models. about appending values that do not exist in the corresponding table of the model.

Yesterday I was playing a little bit about Laravel and VueJs, a simple loop over a model using VueJs’s directive. and I was facing a case I never came across before, I had to print the line containing the information about the Post model and also how many comments have.

This post is submitted by INANI El Houssain.