Download the PHP package italofantone/slugable without Composer
On this page you can find all versions of the php package italofantone/slugable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download italofantone/slugable
More information about italofantone/slugable
Files in italofantone/slugable
Package slugable
Short Description Is a PHP library designed to simplify and automate the creation of URL-friendly slugs based on Laravel.
License MIT
Informations about the package slugable
About Slugable
Is a PHP library designed to simplify and automate the creation of URL-friendly slugs based on Laravel.
⚠️ This code was used for educational purposes [...]
Installation
You can install the slugable package via composer. Run the following command:
Usage
- Add the trait to your model:
To use the Slugable functionality, include the Slugable trait in your Eloquent model. Here's an example:
Migration example: You need to create the slug field.
- Customize the separator: Run the following command.
You can customize the slug separator in the config/slugable.php
file. For example:
This will change the default separator used in generated slugs.
- Customizing the slug source field:
You can customize which attribute is used to generate the slug by setting the protected $slugSourceField
property in your model.
Example:
To use the name attribute instead of the default attribute (like title), do the following:
With this configuration, the slug will be generated based on the name
attribute.
Contact
- Email: [email protected]
- Twitter: @italofantone
- LinkedIn: italofantone
Donations
If you find this project useful and would like to support its development, you can make a donation via PayPal:
- PayPal: Donate via PayPal
Thank you for your support!