laravel pagination : Call to a member function render() on array
<p><a href="https://i.stack.imgur.com/yVgOQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yVgOQ.png" alt="The Following error occurs:"></a></p>

<p>In laravel controller I have following code: <br></p>

<pre><code>public function getAdmins(){
    //$users = $this-&gt;user-&gt;all();

    $search[] =array();
    $search['name']= Input::get('name','');
    $search['uname']= Input::get('uname','');
    $search['role']= Input::get('role','');

    $users = $this-&gt;user-&gt;findUsers($search);

    $exceptSuperadmin = array();
    foreach($users as $user){
        if(!$user-&gt;isUser())
            $staffs[] = $user;
    }
    $users = @$staffs;

    return view('users::admins.list')-&gt;with('staffs',$users)-&gt;with('search',$search);
}
</code></pre>

<p>In Model I have: <br></p>

<pre><code>public function findUsers($search)
{

    return self::where('name','like','%'.$search['name'].'%')
    -&gt;where('username','like','%'.$search['uname'].'%')
    -&gt;where('role','like','%'.$search['role'].'%')
    -&gt;paginate(5);

}
</code></pre>

<p>And In blade file I have: </p>

<pre><code>@if($staffs)

@foreach($staffs as $staff)
        &lt;!-- Some code here to loop array --&gt;
     @endforeach

@else
      No Staffs

@endif 
</code></pre>

<p><code>{!! $staffs-&gt;render() !!}  Error comes at this line</code></p>

<p>I am not geeting why this error comes....staffs is an array and render() a function to echo the pagination pages...but can't getting the error...Anybody to help.</p>