PHP Classes

Slugify Models: Create a URL slug for a Laravel model class

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2022-06-16 (11 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 17 All time: 10,975 This week: 333Up
Version License PHP version Categories
slugify_model 1.0GNU General Publi...7.4HTTP, Blogs, PHP 7, Global


This package can create a URL slug for a Laravel model class.

It provides a helper function that takes as parameters a Laravel model class object or a string and the name of the model title column.

The function computes a slug string that can be used as part of the URL to generate a human-readable URL for pages that show views of model class object information.

Save 'slugify_model.php' in your 'app/Helpers/' directory and update your composer.json to reference and autoload the helper function.

Picture of Shashwat Mishra
Name: Shashwat Mishra <contact>
Classes: 3 packages by
Country: India India
Age: 26
All time rank: 4263295 in India India
Week rank: 578 Up42 in India India Up
Innovation award
Innovation award
Nominee: 1x

  Files folder image Files  
File Role Description
Plain text file examples.php Example Examples to Use the function.
Plain text file composer.json Doc. This shows how to autoload the helper function in laravel.
Plain text file slugify_model.php Class Helper Function

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:10,975
This week:333Up