In this article we have create link to show next and previous navigation link on single post page.
Define the $previous
and $nextvariable
, along with the Post model. Set the where()
clause, pass the id and blog id properties and define the orderBy and first queries to fetch the previous records and post URL or slug from the database.
$previous_record = Post::where('id', '<', $post->id)->orderBy('id','desc')->first();
$next_post = Post::where('id', '>', $post->id)->first();
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>How to Get Previous and Next Record in Laravel</title>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-6">
@if (isset($previous_record))
<a href="{{ url($previous_record->url) }}">
<div> Previous</div>
<p>{{ $previous_record->title }}</p>
</a>
@endif
</div>
<div class="col-6">
@if (isset($next_record))
<a href="{{ url($next_record->url) }}">
<div>Next</div>
<p>{{ $next_record->title }}</p>
</a>
@endif
</div>
</div>
</div>
</body>
</html>
Hope it can help you…
order fenofibrate 160mg generic buy generic fenofibrate over the counter buy fenofibrate 160mg pills
cialis 40mg oral sildenafil 50mg oral sildenafil for men over 50
ketotifen 1mg generic geodon price cheap imipramine
precose 25mg sale order prandin 2mg online purchase fulvicin sale
aspirin 75mg price purchase eukroma online buy zovirax sale
buy dipyridamole 100mg sale order felodipine 10mg without prescription order pravastatin 20mg generic
order prasugrel 10mg pill dramamine 50 mg tablet buy detrol 2mg pills
ferrous 100mg without prescription sotalol order online buy cheap generic betapace
purchase vasotec online bicalutamide 50 mg sale lactulose bottless
purchase zovirax without prescription order xalatan eye drops rivastigmine us
order premarin buy generic premarin 0.625mg sildenafil 50mg
prilosec where to buy buy metoprolol for sale order lopressor pill
micardis 80mg oral plaquenil 400mg usa molnunat 200 mg without prescription
tadalafil 10mg brand order cialis online cheap viagra overnight shipping usa
cenforce 100mg tablet cenforce 50mg drug cheap chloroquine
buy modafinil 100mg how to buy promethazine deltasone 20mg without prescription
Buy Cefixime Online - Special offer: Save up to $498 - https://softlips.ca/tmb/buy-antibiotics-online.html buy antibiotics online and get discount for all purchased! Tag: buy amoxicillin, buy cipro online, buy myambutol online
order generic omnicef buy prevacid 15mg without prescription buy lansoprazole 15mg
buy isotretinoin 40mg without prescription order azithromycin 250mg generic order zithromax 500mg
buy azipro cheap where to buy omnacortil without a prescription gabapentin for sale online
order atorvastatin 80mg pills order albuterol 100 mcg generic purchase norvasc generic
free slot games for fun online casino real money no deposit buy furosemide generic
pantoprazole 20mg uk cheap pyridium pyridium 200 mg pills
gambling sites cheap doxycycline order albuterol 4mg online cheap
real casino games best online casino games buy ivermectin 6 mg online
symmetrel 100 mg uk buy atenolol 100mg online avlosulfon 100mg brand
online casinos for real money order synthroid 150mcg cheap levothroid without prescription
clomiphene 50mg generic order azathioprine 50mg generic imuran 50mg oral
buy methylprednisolone 8 mg online order adalat 30mg sale cost aristocort
buy vardenafil 10mg buy vardenafil 10mg without prescription zanaflex tablet
buy phenytoin 100mg generic cyclobenzaprine 15mg tablet ditropan online
buy coversum generic coversum online buy allegra 120mg sale
Buy Cefadroxil Online - https://amsat-kovert.com/one.html and get discount for all purchased!
generic ozobax cost elavil buy ketorolac pills
purchase loratadine pill altace sale cheap dapoxetine 30mg
lioresal price order toradol online cheap toradol 10mg cost
purchase fosamax pills fosamax price order macrodantin 100mg sale
inderal online order order inderal 10mg sale plavix buy online
Special offer for antibiotics: where to buy antibiotics and get discount for all purchased! Two free pills (Viagra or Cialis or Levitra) available with every order. No prescription required, free delivery.
buy nortriptyline 25 mg generic order nortriptyline generic acetaminophen over the counter
buy amaryl pill arcoxia 120mg pills buy etoricoxib medication
warfarin 2mg brand paxil 10mg without prescription buy metoclopramide 20mg sale
order xenical generic purchase orlistat online cheap diltiazem tablet
pepcid where to buy order pepcid 40mg buy tacrolimus cheap
where can i buy astelin brand avapro 300mg brand avapro
order esomeprazole 40mg generic oral nexium topamax over the counter
imitrex 25mg tablet sumatriptan 25mg pills avodart 0.5mg drug
buy cheap generic zyloprim crestor 10mg brand cheap rosuvastatin 20mg
zantac 150mg sale order ranitidine 150mg without prescription order celebrex 200mg
buspar 5mg pills amiodarone 200mg pill cordarone online order
buy tamsulosin online buy zocor pill simvastatin where to buy
buy motilium 10mg how to buy coreg buy tetracycline medication
aldactone 100mg price buy finasteride tablets propecia online
buy a term paper online academic writing service buy a dissertation
diflucan ca purchase cipro online cheap buy baycip pills for sale
sildenafil 100mg tablet buy generic estrace 1mg yasmin pills
metronidazole without prescription cephalexin 125mg for sale order keflex 500mg online
cost lamotrigine 50mg order prazosin 2mg nemazole us
order cleocin 150mg online cheap erythromycin online buy cost sildenafil 50mg
retin gel uk buy retin gel online buy generic avanafil 200mg
where to buy nolvadex without a prescription purchase nolvadex symbicort oral
purchase tadacip online order tadacip online cheap buy indocin 75mg generic
buy cheap generic ceftin purchase robaxin pill purchase methocarbamol pills
desyrel buy online clindamycin sale clindac a generic
oral lamisil buy lamisil without a prescription online blackjack real money
order aspirin 75mg generic online casino play online blackjack
write college essays for money purchase cefixime without prescription where can i buy cefixime
practice essay writing online gamble online win real money play slots for real money united states
buy amoxicillin 250mg pills order anastrozole 1 mg generic oral biaxin 250mg
purchase rocaltrol tricor price order generic fenofibrate 160mg
doctor prescribed acne treatment adult female acne trileptal 300mg drug
buy clonidine generic order clonidine 0.1mg generic tiotropium bromide 9mcg over the counter
purchase uroxatral best medicine for acid indigestion over the counter stomach cramps
minocin 100mg us buy generic hytrin for sale requip 1mg generic
strongest sleeping pills online can steroids cause hair thinning safest prescription weight loss medication
buy femara cheap order aripiprazole 20mg generic buy aripiprazole pills for sale
champix for quitting smoking osteoporosis pill 1 month buy prescriptions without written script
oral provera 5mg microzide 25mg ca buy hydrochlorothiazide 25mg pills
herpes pills online buy inhalers for asthma online is insulin better than pills
order cyproheptadine periactin 4 mg cost buy ketoconazole generic
vitality health fungus clear reviews daily antiviral for herpes foods that help lower blood pressure
cymbalta without prescription order modafinil pills order modafinil 200mg pill
best over the counter ulcer medication most successful blood pressure medication best online doctor for uti
promethazine 25mg ca buy phenergan no prescription ivermectin drug
3 month birth control pills prostate infection antibiotics not working drugs that delay ejaculation
deltasone 5mg us order isotretinoin 10mg online cheap buy amoxil 500mg pills
order azithromycin 250mg sale order gabapentin online gabapentin 600mg brand
purchase actigall urso pills how to get cetirizine without a prescription
atomoxetine generic strattera 25mg usa sertraline 50mg over the counter
lexapro 20mg sale naltrexone order buy revia pill
where to buy furosemide without a prescription doxycycline price albuterol 4mg inhaler
ipratropium 100 mcg cheap order ipratropium 100mcg sale buy zyvox 600mg generic
buy augmentin generic buy generic synthroid 75mcg clomiphene ca
cheap starlix 120 mg brand starlix 120 mg buy atacand generic
vardenafil without prescription buy vardenafil sale order plaquenil 400mg generic
tegretol oral buy tegretol pill buy generic lincocin
cenforce price cheap cenforce glycomet 500mg usa
buy duricef no prescription lamivudine canada epivir oral
order lipitor for sale lipitor 80mg tablet lisinopril 2.5mg oral
cabergoline price dapoxetine sale dapoxetine buy online
medrol online buy buy desloratadine medication clarinex medication
misoprostol 200mcg generic orlistat 60mg us order diltiazem 180mg pills
order piracetam 800 mg for sale buy piracetam generic anafranil 25mg for sale
how to buy acyclovir acyclovir 800mg ca buy rosuvastatin tablets
Buy Amoxil No Prescription Online - Cheap Amoxil overnight delivery, Purchase Amoxil Without RX.
order itraconazole 100mg generic buy sporanox 100mg buy tinidazole no prescription
order zetia pill domperidone usa sumycin 250mg ca
olanzapine 10mg price nebivolol 5mg cheap diovan 160mg tablet
buy cyclobenzaprine for sale buy generic cyclobenzaprine generic toradol 10mg
order colchicine 0.5mg generic plavix sale buy methotrexate 5mg without prescription
popular prescription acne medication deltasone online order acne treatments that work uk
best allergy pill cetirizine price best generic allegra
most common nausea medication oral epivir
basic care sleep aid order phenergan online cheap
buy deltasone 40mg prednisone sale
anti nausea prescription medication list lincomycin 500 mg ca
topical prescription adult acne medication purchase omnicef pills medication for persistent adult acne
latest on heartburn medication buy cipro cheap
order isotretinoin 20mg without prescription buy generic isotretinoin order isotretinoin 10mg sale
order amoxicillin 250mg amoxil 1000mg uk amoxil 250mg over the counter
uk sleeping pills website modafinil 200mg price
azithromycin pills order zithromax 500mg for sale oral zithromax 250mg
order gabapentin 100mg for sale cheap gabapentin online
azipro 500mg over the counter order azithromycin 500mg sale azipro order
buy furosemide online cheap diuretic order furosemide 40mg
buy generic omnacortil 5mg omnacortil 20mg generic omnacortil uk
Thanks for wonderful information. What trips can you recommend in 2024? Astro tourism, eco diving, home swapping, train stations are the new food destinations,sports tourism, coolcationing, gig tripping, private group travel?
amoxicillin 250mg for sale buy amoxicillin online cheap amoxil cheap
purchase doxycycline online cheap vibra-tabs for sale online
buy generic albuterol 4mg buy generic albuterol albuterol inhaler
order amoxiclav generic order augmentin pill
buy levothroid generic buy synthroid generic order synthroid online
vardenafil online buy levitra 20mg sale
order clomiphene 100mg generic buy clomiphene cheap clomid 100mg price
generic tizanidine how to buy zanaflex tizanidine without prescription
buy rybelsus pills for sale semaglutide brand semaglutide 14 mg pills
brand prednisone deltasone 10mg tablet cheap deltasone
accutane 10mg generic accutane 10mg sale order accutane 20mg without prescription
order amoxil 250mg without prescription order amoxil 500mg online cheap amoxicillin 1000mg generic
asthma pills over the counter buy ventolin paypal order albuterol 2mg
azithromycin over the counter order zithromax online cheap generic azithromycin 250mg
augmentin 1000mg pill clavulanate oral oral clavulanate
omnacortil 20mg drug where to buy omnacortil without a prescription order omnacortil 10mg pill
rybelsus without prescription semaglutide 14mg pill rybelsus oral
play money poker online best online casinos real money crazy poker games
buy levitra 20mg pills levitra 10mg over the counter buy levitra generic
order lyrica 150mg sale buy pregabalin 150mg generic buy lyrica online
buy generic aristocort 10mg order generic triamcinolone 10mg cost triamcinolone
plaquenil canada hydroxychloroquine cost hydroxychloroquine price
buy generic clarinex 5mg brand desloratadine order desloratadine generic
cheapest cialis online buy tadalafil 20mg online cheap cialis tadalafil 40mg
cenforce online order buy cenforce 100mg pills order generic cenforce 50mg
buy loratadine 10mg pills claritin 10mg price claritin over the counter
orlistat 120mg usa diltiazem 180mg pill order diltiazem without prescription
buy glycomet 500mg generic order glucophage generic buy generic glucophage over the counter
order acyclovir 800mg zyloprim 300mg usa zyloprim over the counter
buy cheap generic norvasc amlodipine us buy amlodipine generic
order rosuvastatin 10mg generic order generic rosuvastatin ezetimibe over the counter
order zestril 2.5mg online lisinopril sale lisinopril order
domperidone usa tetracycline 250mg usa buy sumycin cheap
buy prilosec tablets omeprazole to treat reflux order generic prilosec 20mg
order flexeril 15mg pill buy generic flexeril online lioresal pills
metoprolol buy online order lopressor for sale metoprolol over the counter
buy toradol 10mg pill oral colcrys 0.5mg buy gloperba cheap
order atenolol 50mg pill where can i buy atenolol tenormin where to buy