Call to a member function paginate() on array
<p>I am working with Laravel5.0 . I want to add <code>paginate()</code> to the following function of my controller part.</p>

<pre><code>public function index()
{
    try{
        $val=DB::connection()-&gt;getDatabaseName();
        if(DB::connection()-&gt;getDatabaseName()) {
            //$bRecord = DB::table('bills')-&gt;orderBy('Date', 'desc')-&gt;paginate(4);

            $bRecord = DB::table('bills')
                -&gt;join('clients', 'bills.ClientID', '=', 'clients.ClientID')
                -&gt;select('bills.ReceiptID', 'bills.ClientID', 'bills.Paid', 'bills.Date','bills.ReceivedBy',
                    'clients.ClientName')
                -&gt;get();

            return view('bills.billRecord')-&gt;with('bRecord', $bRecord);
        }else{
            $er="/connection status: database error";
            return view('home')-&gt;with('error',$er);         //'error' is passed to home
        }
    }catch (\Exception $e){
        $er="/connection status: database error";
        return view('home')-&gt;with('error',$er);
    }

}
</code></pre>

<p>if I add paginate here, it shows error. "Call to a member function paginate() on array"</p>

<pre><code>$bRecord = DB::table('bills')
                -&gt;join('clients', 'bills.ClientID', '=', 'clients.ClientID')
                -&gt;select('bills.ReceiptID', 'bills.ClientID', 'bills.Paid', 'bills.Date','bills.ReceivedBy',
                    'clients.ClientName')
                -&gt;get()-&gt;paginate(4);
</code></pre>

<p>How can I use <code>paginate()</code> here?</p>