Documentation

Repository

Repository

Table of Contents

__construct()  : mixed
Repository Constructor.
all()  : SettingsCollection
Get all the Settings.
allOfDataType()  : SettingsCollection
Get all Settings of a SettingType.
allOfSettingType()  : SettingsCollection
Get all Settings of a SettingType.
allRelatedToModel()  : SettingsCollection
Get all Settings related to a Model.
app()  : Repository
Get app scoped repository.
find()  : Setting|null
Find a Setting.
findOrFail()  : Setting
Find a Setting, or fail.
get()  : mixed
Get a Setting's value or the default.
global()  : Repository
Get global scoped repository.
instance()  : static
New repository instance.
model()  : Repository
Get model scoped repository.
newQuery()  : Builder
New query.
query()  : Builder
Get the current query.
set()  : Setting|null
Set a setting.
user()  : Repository
Get user scoped repository.
where()  : Builder
Where query.
whereOwner()  : Builder
Where the owner is.

Methods

__construct()

Repository Constructor.

public __construct([SettingType|null $scopeSettingType = null ][, Model|Authenticatable|null $scopeOwner = null ][, DataType|null $scopeDataType = null ][, Builder|null $query = null ]) : mixed
Parameters
$scopeSettingType : SettingType|null = null
$scopeOwner : Model|Authenticatable|null = null
$scopeDataType : DataType|null = null
$query : Builder|null = null
Return values
mixed

app()

Get app scoped repository.

public static app([DataType|null $scopeDataType = null ][, Builder|null $query = null ]) : Repository
Parameters
$scopeDataType : DataType|null = null
$query : Builder|null = null
Return values
Repository

find()

Find a Setting.

public find(string $key) : Setting|null
Parameters
$key : string
Return values
Setting|null

findOrFail()

Find a Setting, or fail.

public findOrFail(string $key) : Setting
Parameters
$key : string
Tags
throws
ItemNotFoundException
Return values
Setting

get()

Get a Setting's value or the default.

public get(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string
$default : mixed = null
Return values
mixed

global()

Get global scoped repository.

public static global([DataType|null $scopeDataType = null ][, Builder|null $query = null ]) : Repository
Parameters
$scopeDataType : DataType|null = null
$query : Builder|null = null
Return values
Repository

instance()

New repository instance.

public static instance([SettingType|null $scopeSettingType = null ][, Model|Authenticatable|null $scopeOwner = null ][, DataType|null $scopeDataType = null ][, Builder|null $query = null ]) : static
Parameters
$scopeSettingType : SettingType|null = null
$scopeOwner : Model|Authenticatable|null = null
$scopeDataType : DataType|null = null
$query : Builder|null = null
Return values
static

model()

Get model scoped repository.

public static model(Model $scopeOwner[, DataType|null $scopeDataType = null ][, Builder|null $query = null ]) : Repository
Parameters
$scopeOwner : Model
$scopeDataType : DataType|null = null
$query : Builder|null = null
Return values
Repository

newQuery()

New query.

public newQuery() : Builder
Return values
Builder

query()

Get the current query.

public query() : Builder
Return values
Builder

set()

Set a setting.

public set(string $key, mixed $value[, string|null $description = null ][, SettingType|null $settingType = null ][, DataType|null $dataType = null ][, Model|null $owner = null ]) : Setting|null
Parameters
$key : string
$value : mixed
$description : string|null = null
$settingType : SettingType|null = null
$dataType : DataType|null = null
$owner : Model|null = null
Return values
Setting|null

user()

Get user scoped repository.

public static user([Model|Authenticatable|null $scopeUser = null ][, DataType|null $scopeDataType = null ][, Builder|null $query = null ]) : Repository
Parameters
$scopeUser : Model|Authenticatable|null = null
$scopeDataType : DataType|null = null
$query : Builder|null = null
Return values
Repository

where()

Where query.

public where(string $field, mixed $operatorOrValue[, mixed $valueOrNull = null ]) : Builder
Parameters
$field : string
$operatorOrValue : mixed
$valueOrNull : mixed = null
Return values
Builder

whereOwner()

Where the owner is.

public whereOwner(Model $owner) : Builder
Parameters
$owner : Model
Return values
Builder

Search results