Feature: Ability to call setRelation
(actually anything) for every Model
instance.
#2862
Labels
setRelation
(actually anything) for every Model
instance.
#2862
Let me go through it step by step:
1- I extended the default
EloquentDataTable
and added a method that overwrites theprocessResults
method. This allows me to interact with theDataProcessor
object.2- I also needed to extend the
DataProcessor
so that I can customize theprocess
method. This is where we run the callback function we defined for a given model.3- I think the
setRelationsCallback
name is wrong, since this gives us the ability to do whatever we want with theModal
instance of every row. Here is what I did with mine:Let me know what you think about this.
I am not sure how useful this might be since it's theoretically just
1 Less Query
and1 Less Model Instance in memory
.The text was updated successfully, but these errors were encountered: