akrillia/laravel-permalinks

0.0.5 2023-01-24 11:10 UTC

This package is auto-updated.

Last update: 2024-10-24 14:53:43 UTC


README

assets/banner.png

This package allows you to easily create permalinks for your Laravel application.

Installation

To install the package, simply run the following command in your terminal:

composer require akrillia/laravel-permalinks

Then, add the service provider to the providers array in your config/app.php file:

AkrilliA\LaravelPermalinks\LaravelPermalinksServiceProvider::class

Usage

To create a permalink, you first need to generate a slug and then create the permalink link.

Generate a slug

$slug = GenerateSlug::execute($name);

Create a permalink link

$permalink = Permalink::create($url, $slug);

Alternatively you can call, which will automatically create a slug based on the URL.

$permalink = Permalink::create($url);

This will return an instance of Permalink.

Configuration

You can configure the package by publishing the config file using the following command:

php artisan vendor:publish --provider="AkrilliA\LaravelPermalinks\LaravelPermalinksServiceProvider"

This will create a permalinks.php file in your config directory. You can modify the settings in this file to suit your needs.

License

This package is open-source software licensed under the ISC.

Support

If you need any help, please contact me on my email or open an issue on GitHub.