skip to Main Content

When I try to use $student->links() I see this error :

FacadeIgnitionExceptionsViewException
Call to undefined method AppStudent::links()

I checked the controller, model etc but all of them seem OK… How can I fix this?

(I tried this code both on my Macbook and VPS -CentOS7- but same problem occurs)

That part of my view looks like this:

      </tr>
            @endforeach
           </tbody>
         </table>
            {{ $student->links() }}
         </div>
       @endsection

2

Answers


  1. You need to paginate in your backend code. $students = AppStudent::paginate(15);

    And then you can access the links()

    <div class="container">
        @foreach ($students as $student)
            {{ $student->name }}
        @endforeach
    </div>
    
    {{ $students->links() }}
    
    Login or Signup to reply.
  2. Change

    {{ $student->links() }}
    

    to

    {{ $students->links() }}
    

    (use plural form).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search