shone83
6 months ago
419
3
Vue

When I'm using Laravel Vue Pagination I can only load first page of relationship table

Posted 6 months ago by shone83

I'm using gilbitron/laravel-vue-pagination and I can only fetch first page of relationship table as select or a list if that table is paginated, I can't fetch all data. In controller I return data like this:

public function index()
{
    return Settlement::with('town')->paginate(10);
}

and in Vue I fetch like this:

loadSettlements() {
  axios.get('api/settlement').then(response => { this.settlements = response.data.data; });
},

and I called this.loadSettlements();

I assumed that is another way to do in controller because I tried everything that I can find for fetching in Vue...

Please sign in or create an account to participate in this conversation.