Download the PHP package lukeraymonddowning/self-healing-urls without Composer

On this page you can find all versions of the php package lukeraymonddowning/self-healing-urls. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package self-healing-urls

Self Healing URLs

Self Healing URLs is a simple Laravel package inspired by this video from Aaron Francis.

It allows you to mark Eloquent models as self-healing so that the URLs generated for said models can include an SEO friendly slug whilst not breaking should the slug alter in any way.

Installation

The package can be installed via Composer:

Once installed, add the HasSelfHealingUrls trait to any Eloquent model:

If your model has a column named slug, you're all set. Otherwise, define a $slug property on your model to inform the package which column to use instead:

Don't worry if your "slug" isn't URL friendly; the package will take care of formatting it for you. In fact, it doesn't even have to be unique because the defined unique identifier for your model will also be included at the end.

Limitations

By default, the package requires that your unique identifier (such as the id or uuid column) not have any - characters. You can implement your own IdentifierHandler as detailed in the next section.

Unless you implement a custom Rerouter, the package requires that you have defined names to the routes you want to use with self healing URLs.

Using a custom IdentifierHandler

If you need to customize how a slug is joined to a model identifier (which by default is just a hyphen), you can create your own class implementing IdentifierHandler and register it in the register method of your AppServiceProvider.

Here is an example using an _ instead of a hyphen:

Register the custom handler in your AppServiceProvider like so:

Attributions

Without Aaron's video, I wouldn't have even thought about this, so props to him. Go watch the video.


All versions of self-healing-urls with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laravel/framework Version ^10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lukeraymonddowning/self-healing-urls contains the following files

Loading the files please wait ....