PHP 클래스 Cviebrock\EloquentSluggable\Services\SlugService

파일 보기 프로젝트 열기: cviebrock/eloquent-sluggable 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$model Illuminate\Database\Eloquent\Model;

공개 메소드들

메소드 설명
buildSlug ( string $attribute, array $config, boolean $force = null ) : null | string Build the slug for the given attribute of the current model.
createSlug ( Model | string $model, string $attribute, string $fromString, array $config = null ) : string Generate a unique slug for a given string.
getConfiguration ( array $overrides = [] ) : array Get the sluggable configuration for the current model, including default values where not specified.
setModel ( Model $model )
slug ( Model $model, boolean $force = false ) : boolean Slug the current model.

보호된 메소드들

메소드 설명
generateSlug ( string $source, array $config, string $attribute ) : string Generate a slug from the given source string.
generateSuffix ( string $slug, string $separator, Collection $list ) : string Generate a unique suffix for the given slug (and list of existing, "similar" slugs.
getExistingSlugs ( string $slug, string $attribute, array $config ) : Collection Get all existing slugs that are similar to the given slug.
getSlugEngine ( string $attribute ) : Slugify Return a class that has a slugify() method, used to convert strings into slugs.
getSlugSource ( mixed $from ) : string Get the source string for the slug.
makeSlugUnique ( string $slug, array $config, string $attribute ) : string Checks if the slug should be unique, and makes it so if needed.
needsSlugging ( string $attribute, array $config ) : boolean Determines whether the model needs slugging.
usesSoftDeleting ( ) : boolean Does this model use softDeleting?
validateSlug ( string $slug, array $config, string $attribute ) : string Checks that the given slug is not a reserved word.

메소드 상세

buildSlug() 공개 메소드

Build the slug for the given attribute of the current model.
public buildSlug ( string $attribute, array $config, boolean $force = null ) : null | string
$attribute string
$config array
$force boolean
리턴 null | string

createSlug() 공개 정적인 메소드

Generate a unique slug for a given string.
public static createSlug ( Model | string $model, string $attribute, string $fromString, array $config = null ) : string
$model Illuminate\Database\Eloquent\Model | string
$attribute string
$fromString string
$config array
리턴 string

generateSlug() 보호된 메소드

Generate a slug from the given source string.
protected generateSlug ( string $source, array $config, string $attribute ) : string
$source string
$config array
$attribute string
리턴 string

generateSuffix() 보호된 메소드

Generate a unique suffix for the given slug (and list of existing, "similar" slugs.
protected generateSuffix ( string $slug, string $separator, Collection $list ) : string
$slug string
$separator string
$list Illuminate\Support\Collection
리턴 string

getConfiguration() 공개 메소드

Get the sluggable configuration for the current model, including default values where not specified.
public getConfiguration ( array $overrides = [] ) : array
$overrides array
리턴 array

getExistingSlugs() 보호된 메소드

Get all existing slugs that are similar to the given slug.
protected getExistingSlugs ( string $slug, string $attribute, array $config ) : Collection
$slug string
$attribute string
$config array
리턴 Illuminate\Support\Collection

getSlugEngine() 보호된 메소드

Return a class that has a slugify() method, used to convert strings into slugs.
protected getSlugEngine ( string $attribute ) : Slugify
$attribute string
리턴 Cocur\Slugify\Slugify

getSlugSource() 보호된 메소드

Get the source string for the slug.
protected getSlugSource ( mixed $from ) : string
$from mixed
리턴 string

makeSlugUnique() 보호된 메소드

Checks if the slug should be unique, and makes it so if needed.
protected makeSlugUnique ( string $slug, array $config, string $attribute ) : string
$slug string
$config array
$attribute string
리턴 string

needsSlugging() 보호된 메소드

Determines whether the model needs slugging.
protected needsSlugging ( string $attribute, array $config ) : boolean
$attribute string
$config array
리턴 boolean

setModel() 공개 메소드

public setModel ( Model $model )
$model Illuminate\Database\Eloquent\Model

slug() 공개 메소드

Slug the current model.
public slug ( Model $model, boolean $force = false ) : boolean
$model Illuminate\Database\Eloquent\Model
$force boolean
리턴 boolean

usesSoftDeleting() 보호된 메소드

Does this model use softDeleting?
protected usesSoftDeleting ( ) : boolean
리턴 boolean

validateSlug() 보호된 메소드

Checks that the given slug is not a reserved word.
protected validateSlug ( string $slug, array $config, string $attribute ) : string
$slug string
$config array
$attribute string
리턴 string

프로퍼티 상세

$model 보호되어 있는 프로퍼티

protected Model;,Illuminate\Database\Eloquent $model
리턴 Illuminate\Database\Eloquent\Model;