Download the PHP package alexeymezenin/laravel-russian-slugs without Composer

On this page you can find all versions of the php package alexeymezenin/laravel-russian-slugs. 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 laravel-russian-slugs

The package is not supported anymore

Introduction

This package offers easy to use cyrillic slugs like 'Как_вырастить_дерево' and Yandex transliterated 'kak-vyrastis-derevo' slugs and their variations with lowercased letters and different separators.

Installation

Start with editing your Laravel project's composer.json file, add this line to the require section:

After that run this command to install package:

Now, insert these two lines into provider and aliases arrays in config/app.php:

Finally, you need to register config file and slugs-related commands by running:

Using slugs

To use package, you need to update your models with thisuse clause:

Then you need to create slug column in a migration:

To use auto slug creation feature add slugFrom property to your model:

In this case, every time when you're saving data to a DB, package tries to create (but not recreate) a new slug and save it:

Of course, that doesn't work with mass inserts and updates when you're updating multiple rows with one query.

Manual slug creation

To create new record with a slug use reslug() method. This will add slug, based on name column:

You can update existing record and add a slug:

If slug already exists, but you need to recreate it, use forced reslug:

Alternatively, you can use Slug facade to manually work with slugs:

findBySlug() method allows you to find a model by it's slug:

Configuration

To configure a package you should edit config/seoslugs.php file.

delimiter is a symbol which replaces all spaces in a string. By default it's '_', but also can be '-'.

urlType is a type of slug:

Default is 1. Used for URLs like /категория/книги_в_москве

2 is for traslitterated URLs like /kategoriya/knigi_v_moskve, Yandex rules used to transliterate URL.

keepCapitals is false by default. When true it keeps capital letters in a slug, for example: /книги_в_Москве

slugColumnName sets the name of a slug column. slug by default.

Commands

There are three console commands available in the package:

php artisan slug:auto {table} {column} command creates and executes migration, reslugs a table (creates slugs for all rows) using {column} as source.

php artisan slug:migration {table} command creates migration to add a slug column.

php artisan slug:reslug {table} {column} command creates or recreates slugs for a specified table.

Commands slug:auto and slug:reslug will recreate all slugs, even if they are already exist (forced reslug used).

Copyright

RussianSeoSlugs was written by Alexey Mezenin and released under the MIT License.


All versions of laravel-russian-slugs with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.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 alexeymezenin/laravel-russian-slugs contains the following files

Loading the files please wait ....