PHP 트레잇 Cviebrock\EloquentSluggable\SluggableScopeHelpers

Helper trait for defining the primary slug of a model and providing useful scopes and query methods.
파일 보기 프로젝트 열기: cviebrock/eloquent-sluggable

공개 메소드들

메소드 설명
findBySlug ( string $slug, array $columns = ['*'] ) : Model | Illuminate\Database\Eloquent\Collection | static[] | static | null Find a model by its primary slug.
findBySlugOrFail ( string $slug, array $columns = ['*'] ) : Model | Illuminate\Database\Eloquent\Collection Find a model by its primary slug or throw an exception.
getSlugKey ( ) : string Primary slug value of this model.
getSlugKeyName ( ) : string Primary slug column of this model.
scopeWhereSlug ( Builder $scope, string $slug ) : Builder Query scope for finding a model by its primary slug.

메소드 상세

findBySlug() 공개 정적인 메소드

Find a model by its primary slug.
public static findBySlug ( string $slug, array $columns = ['*'] ) : Model | Illuminate\Database\Eloquent\Collection | static[] | static | null
$slug string
$columns array
리턴 Illuminate\Database\Eloquent\Model | Illuminate\Database\Eloquent\Collection | static[] | static | null

findBySlugOrFail() 공개 정적인 메소드

Find a model by its primary slug or throw an exception.
public static findBySlugOrFail ( string $slug, array $columns = ['*'] ) : Model | Illuminate\Database\Eloquent\Collection
$slug string
$columns array
리턴 Illuminate\Database\Eloquent\Model | Illuminate\Database\Eloquent\Collection

getSlugKey() 공개 메소드

Primary slug value of this model.
public getSlugKey ( ) : string
리턴 string

getSlugKeyName() 공개 메소드

Primary slug column of this model.
public getSlugKeyName ( ) : string
리턴 string

scopeWhereSlug() 공개 메소드

Query scope for finding a model by its primary slug.
public scopeWhereSlug ( Builder $scope, string $slug ) : Builder
$scope Illuminate\Database\Eloquent\Builder
$slug string
리턴 Illuminate\Database\Eloquent\Builder