MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

How to use Slug For Custom Url

Slug is used to define custom Url based on the title .it gives users SEO-friendly way to access it through the URL.

http://holidaylandmark/city/Mumbai

Creating Slug Field in Table:

Syntax:

Laravel migration code adding a slug string column to the table

Save Slug in Database using store function

Laravel save function getting the city name from the City model by city_id
Code setting the slug to the city name and saving the record

Pass Slug id in Button

Blade link passing the slug to the show route with route('show', $gall->slug)

Use Slug Id In Show Function

Laravel show function querying packages with joins and filtering by packages.slug

Setting Slug IN Routing

Laravel route city/{slug} pointing to GuestController@show, named show

Click Image To Show Slug

Hawa Mahal in Jaipur thumbnail that opens the city page through its slug URL

http://holidaylandmark/city/Mumbai

mumbai city is slug url

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals

Related Posts

Full Working Example — Paytm Integration in Laravel

I’ll give you a full working Paytm Payment Gateway integration example in Laravel — step-by-step, including payment page, initiate payment, callback handling, and success/failure handling. 🚀 Full…

Read More

Top 100 laravel interview questions and answers

1) What is Laravel? Laravel is an open-source widely used PHP framework. The platform was intended for the development of web application by using MVC architectural pattern….

Read More

Complete Guide and Tutorials for Routing in Laravel

Routing All Laravel routes are defined in your route files, which are located in the routes directory. These files are automatically loaded by the framework.The routes/web.php file…

Read More

How to Display Recent and popular data from Database using left join and OderBy

Fist Step In Welcome.blade.php file for Table Secound Step In Pages.blade.php Third Step In Routing, Go To web.php Forth Step In GestController.php This is Return $gallery View…

Read More

How to Delete Multiple Records using Checkbox in Laravel?

It’s almost need to give feature for remove multiple records using checkbox, if you are developing e-commerce application or any big web application then you must give…

Read More

Basic Things To Find Error In Laravel

To be master in finding error and build logic to make query, certain things should understand properly (i) check wheather your routing working properly or controller working…

Read More