DataSet


Article 1
Jane Doe
Category 1, Category 2
Article 10
Jane Doe

Article 11
Jhon Doe

Article 12
Jane Doe

Article 13
Jane Doe

Article 14
Jane Doe

Article 15
Jane Doe

Article 16
Jane Doe

Article 17
Jhon Doe

order by title asc,
order by title desc


class DemoController extends Controller

....

    public function 
getSet()
    {
        
$set = \DataSet::source(Article::with('author''categories'));
        
$set->addOrderBy(['title','id']);
        
$set->paginate(9);
        
$set->build();

        return  
view('rapyd::demo.set'compact('set'));
    }



@extends('rapyd::demo.demo')

@section('title','DataSet')

@section('body')


    <h1>DataSet </h1>

    <br />

    <div class="container">
        <div class="row">


           <div class="col-sm-8">
               <div class="row">

               @foreach ($set->data as $item)
                    <div class="col-sm-4" style="margin-bottom: 5px">
                        <strong>{!! $item->title !!}</strong><br />
                        <em>{!! $item->author->firstname !!} {!! $item->author->lastname !!}</em><br />
                        <small>{!! implode(", ", $item->categories->pluck("name")->all())  !!}</small><br />
                    </div>
                @endforeach

               </div>
               {!! $set->links() !!}
           </div>

            <div class="col-sm-4">
                order by <strong>title <a href="{!! $set->orderbyLink('title', 'asc') !!}">asc</a></strong>,<br />
                order by <strong>title <a href="{!! $set->orderbyLink('title', 'desc') !!}">desc</a></strong><br />

            </div>


        </div>
    </div>

    
    

@stop