D
D
Dmitry Lakhno2017-07-28 17:30:13
Laravel
Dmitry Lakhno, 2017-07-28 17:30:13

How to get multiple models in Laravel 5?

Tell me how to get several models in one LengthAwarePaginator Get
the collection out, I do this:

$clinic =  Actions_clinic::select('*')->get();
        if($clinic){
            $clinic->load(
                'actions_clinic',
                'actions_clinic.districts',
                'actions_clinic.metros'
            );
        }
        $analyze =  Actions_analyze::select('*')->get();
        $collection  = new Collection;
        $actions = $collection->merge($clinic)->merge($analyze);
        return $actions;

How do I add court pagination?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Timofey, 2017-07-28
@lahno

LengthAwarePaginator constructor not suitable? :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question