I'm using Laravel 5.7 & VueJs 2.5.* ...
I did pagination for my invoice as well as vendor table. i have a create invoice form in which i have dropdown option for selecting vendors, i have more than 20 vendors, after doing pagination i see in my form i have only 10 vendors in my dropdown option... I don't know how to fix this issue.
Did Pagination Like this:
In HTML
<!--PAGINATION FOR VENDORS TABLE -->
<pagination :data="ticketInvoices" @pagination-change-page="getResults"></pagination>
<!--PAGINATION FOR VENDORS TABLE -->
<pagination :data="vendors" @pagination-change-page="getResults"></pagination>
methods:{} of both pagination
//METHOD FOR INVOICE
getResults(page = 1) {
axios.get("api/ticket-invoice?page=" + page).then(response => {
this.ticketInvoices = response.data;
});
},
//METHOD FOR VENDOR
getResults(page = 1) {
axios.get("api/vendor?page=" + page).then(response => {
this.vendors = response.data;
});
},
InvoiceController & VendorController
/*Invoice Controller*/
class TicketInvoiceController extends Controller
{
public function index()
{
$ticketInvoices = TicketInvoice::orderBy('created_at', 'desc')->paginate(10);
return $ticketInvoices;
}
/*Invoice Controller*/
class VendorController extends Controller
{
public function index()
{
$vendor = Vendor::paginate(10);
return $vendor;
}
Before Pagination

After Pagination
