I have a form that is used to filter results for a categories page. So, the URL will be localhost/public/search?keyword=blue
however when I attempt to paginate() them the URL shows up as localhost/public/search?page=2
and so on. If I manually add the page=2
part to the end of the url it works fine but it's not adding it to the URL with the get request as needed. It needs to show up as localhost/search?keyword=blue&page=2
Not sure if needed but here is my method that handles the paginate()
$category = Inventory::select('inventory_images.image', 'inventory.id' , 'inventory.sku', 'inventory.name', 'inventory.price', 'inventory_categories.category')
->join('inventory_categories', 'inventory.sku', '=', 'inventory_categories.sku')
->leftJoin('inventory_images', 'inventory.sku', '=', 'inventory_images.sku')
->where('inventory.active', '=', 1)
->where('inventory.stock_quantity', '>', 2)
->where('inventory.description', 'LIKE', '%'. Input::get('keyword') . '%')
->orWhere('inventory.name', 'LIKE', '%'. Input::get('keyword') . '%')
->groupby('inventory.id')
->take(1000)
->paginate(16);