class Locations_model extends AbstractLocation

Locations Model Class

Traits

HasPermalink model trait Usage: * In the model class definition: use \Igniter\Flame\Database\Traits\HasPermalink; You can change the slug field used by declaring: protected $permalink = ['permalink_slug' => ['source' => 'name']];

Purgeable model trait

Extendable Trait Allows for "Private traits"

Adds event related features to any class.

Constants

KM_UNIT

M_UNIT

OPENING

DELIVERY

COLLECTION

LOCATION_CONTEXT_SINGLE

LOCATION_CONTEXT_MULTIPLE

Properties

protected array $extensionData from  ExtendableTrait
static protected array $extendableCallbacks from  ExtendableTrait
static protected array $extendableStaticMethods from  ExtendableTrait
static protected bool $extendableGuardProperties from  ExtendableTrait
static protected ClassLoader $extendableClassLoader from  ExtendableTrait
protected array $emitterSingleEvents from  EventEmitter
protected array $emitterEvents from  EventEmitter
protected array $emitterEventSorted from  EventEmitter
$relation
static protected array $relationTypes from  HasRelationships
array $implement from  Model
protected array $attributes from  Model
$timestamps
protected string $timeFormat

The storage format of the model's time columns.

from  Model
protected $casts
static protected array $eventsBooted from  Model
static protected string[] $primitiveCastTypes

The built-in, primitive cast types supported by Eloquent.

from  Model
protected string $table from  AbstractLocation
protected string $primaryKey from  AbstractLocation
protected Collection $deliveryAreas from  HasDeliveryAreas
protected array $unAttachedMediaItems from  HasMedia
protected array $originalPurgeableValues from  Purgeable
protected $appends
protected $hidden
protected $purgeable
$permalinkable
$mediable
static protected $allowedSortingColumns
$url
static protected $defaultLocation

Methods

extendableConstruct()

Constructor.

static void
extendableExtendCallback(callable $callback)

Helper method for ::extend() static method

static void
clearExtendedClasses()

Clear the list of extended classes so they will be re-extended.

string
extensionNormalizeClassName(string $name)

Normalizes the provided extension name allowing for the ClassLoader to inject aliased classes

extendClassWith(string $extensionName)

Dynamically extend a class with a specified behavior

void
extensionExtractMethods(string $extensionName, object $extensionObject)

Extracts the available methods from a behavior and adds it to the list of callable methods.

addDynamicMethod(string $dynamicName, callable $method, string $extension = null)

Programmatically adds a method to the extendable class

addDynamicProperty(string $dynamicName, string $value = null)

Programatically adds a property to the extendable class

bool
isClassExtendedWith(string $name)

Check if extendable class is extended with a behavior object

mixed
getClassExtension(string $name)

Returns a behavior object from an extendable class, example:

mixed
asExtension(string $shortName)

Short hand for getClassExtension() method, except takes the short extension name, example:

bool
methodExists(string $name)

Checks if a method exists, extension equivalent of method_exists()

array
getClassMethods()

Get a list of class methods, extension equivalent of get_class_methods()

array
getDynamicProperties()

Returns all dynamic properties and their values

bool
propertyExists(string $name)

Checks if a property exists, extension equivalent of property_exists()

bool
extendableIsAccessible(mixed $class, string $propertyName)

Checks if a property is accessible, property equivalent of is_callabe()

string
extendableGet(string $name)

Magic method for __get()

string
extendableSet(string $name, string $value)

Magic method for __set()

mixed
extendableCall(string $name, array $params = null)

Magic method for __call()

static mixed
extendableCallStatic(string $name, array $params = null)

Magic method for __callStatic()

ClassLoader|null
extensionGetClassLoader()

Gets the class loader

bindEvent(string $event, callable $callback, int $priority = 0)

Create a new event binding.

bindEventOnce(string $event, callable $callback)

Create a new event binding that fires once only

void
emitterEventSortEvents(string $eventName)

Sort the listeners for a given event by priority.

unbindEvent(string $event = null)

Destroys an event binding.

string|array
fireEvent(string $event, array $params = [], bool $halt = false)

Fire an event and call the listeners.

mixed
fireSystemEvent(string $event, array $params = [], bool $halt = true)

Fires a combination of local and global events. The first segment is removed from the event name locally and the local object is passed as the first argument to the event globally. Halting is also enabled by default.

void
addCasts(array $attributes)

Add attribute casts for the model.

getAttribute($key)

No description

getAttributeValue($key)

No description

attributesToArray()

No description

setAttribute(string $key, mixed $value)

Set a given attribute on the model.

asSerialized($value)

No description

fromSerialized($value)

No description

isSerializedCastable($key)

No description

asDateTime($value)

No description

asTime($value)

No description

string
fromTime(Carbon|int $value)

Convert a Carbon Time to a storable string.

bool
isTimeCastable(string $key)

Determine whether a value is Time castable for inbound manipulation.

string
getTimeFormat()

Get the format for database stored times.

setTimeFormat(string $format)

Set the time format used by the model.

hasRelation($name)

No description

array
getRelationDefinition(string $name)

Returns relationship details from a supplied name.

array
getRelationDefinitions()

Returns relationship details for all relations defined on this model.

string
getRelationType(string $name)

Returns a relationship type based on a supplied name.

mixed
getRelationValue(string $key)

Get a relationship.

$this
setRelationValue($relationName, $value)

Sets a relation value directly from its attribute.

string
makeRelation(string $name)

Returns a relation class object

bool
isRelationPushable(string $name)

Determines whether the specified relation should be saved when push() is called instead of save() on the model. Default: true.

array
getRelationDefaults(string $type)

Returns default relation arguments for a given type.

handleRelation($relationName)

No description

array
validateRelationArgs($relationName, $optional, array $required = [])

Validate relation supplied arguments.

HasOne
hasOne(string $related, string|null $foreignKey = null, string|null $localKey = null, null $relationName = null)

Define a one-to-one relationship.

hasOneThrough($related, $through, $primaryKey = null, $throughKey = null, $localKey = null, $secondLocalKey = null, $relationName = null)

Define a has-one-through relationship.

HasMany
hasMany(string $related, string|null $foreignKey = null, string|null $localKey = null, null $relationName = null)

Define a one-to-many relationship.

HasManyThrough
hasManyThrough(string $related, string $through, string|null $firstKey = null, string|null $secondKey = null, string|null $localKey = null, string|null $secondLocalKey = null, null $relationName = null)

Define a has-many-through relationship.

belongsTo($related, $foreignKey = null, $ownerKey = null, $relationName = null)

No description

belongsToMany($related, $table = null, $foreignPivotKey = null, $relatedPivotKey = null, $parentKey = null, $relatedKey = null, $relationName = null)

No description

MorphOne
morphOne(string $related, string $name, string|null $type = null, string|null $id = null, string|null $localKey = null, null $relationName = null)

Define a polymorphic one-to-one relationship.

MorphTo
morphEagerTo(string $name, string $type, string $id, $ownerKey)

Define a polymorphic, inverse one-to-one or many relationship.

MorphTo
morphInstanceTo(string $target, string $name, string $type, string $id, $ownerKey)

Define a polymorphic, inverse one-to-one or many relationship.

MorphMany
morphMany(string $related, string $name, string|null $type = null, string|null $id = null, string|null $localKey = null, null $relationName = null)

Define a polymorphic one-to-many relationship.

morphToMany(string $related, string $name, string|null $table = null, string|null $foreignPivotKey = null, string|null $relatedPivotKey = null, string|null $parentKey = null, string|null $relatedKey = null, bool $inverse = false, null $relationName = null)

Define a polymorphic many-to-many relationship.

morphedByMany(string $related, string $name, string|null $table = null, string|null $foreignPivotKey = null, string|null $relatedPivotKey = null, string|null $parentKey = null, string|null $relatedKey = null, null $relationName = null)

Define a polymorphic, inverse many-to-many relationship.

__construct(array $attributes = [])

No description

from  Model
static Model|Model
make(array $attributes = [])

Create a new model and return the instance.

from  Model
static Model|Model
create(array $attributes = [], string $sessionKey = null)

Save a new model and return the instance.

from  Model
Model|Model
reload()

Reloads the model attributes from the database.

from  Model
void
reloadRelations(string $relationName = null)

Reloads the model relationship cache.

from  Model
static 
extend(Closure $callback)

Extend this object properties upon construction.

from  Model
bootNicerEvents()

Bind some nicer events to this model, in the format of method overrides.

from  Model
static void
flushEventListeners()

Remove all of the event listeners for the model Also flush registry of models that had events booted Allows painless unit testing.

from  Model
Model|Model
newFromBuilder(array $attributes = [], null $connection = null)

Create a new model instance that is existing.

from  Model
beforeCreate()

Handle the "creating" model event

from  Model
afterCreate()

Handle the "created" model event

from  Model
beforeUpdate()

Handle the "updating" model event

from  Model
afterUpdate()

Handle the "updated" model event

from  Model
beforeSave()

Handle the "saving" model event

from  Model
afterSave()

Handle the "saved" model event

beforeDelete()

Handle the "deleting" model event

afterDelete()

Handle the "deleted" model event

from  Model
beforeFetch()

Handle the "fetching" model event

from  Model
afterFetch()

Handle the "fetched" model event

from  Model
static void
fetching(Closure|string $callback)

Create a new native event for handling beforeFetch().

from  Model
static void
fetched(Closure|string $callback)

Create a new native event for handling afterFetch().

from  Model
setUpdatedAt($value)

No description

from  Model
setCreatedAt($value)

No description

from  Model
array
getObservableEvents()

Get the observable event names.

from  Model
isRelationPurgeable($name)

No description

from  Model
newEloquentBuilder(Builder $query)

Create a new Eloquent query builder for the model.

from  Model
string
getForeignKey()

Get the default foreign key name for the model.

from  Model
__get($key)

No description

from  Model
__set($name, $value)

No description

from  Model
mixed
__call(string $method, $params)

Handle dynamic method calls into the model.

from  Model
newPivot(Model $parent, array $attributes, string $table, bool $exists, string|null $using = null)

Create a generic pivot model instance.

from  Model
newRelationPivot(string $relationName, Model $parent, array $attributes, string $table, bool $exists)

Create a pivot model instance specific to a relation.

from  Model
bool
saveInternal(array $options = [])

Save the model to the database. Is used by save()

from  Model
bool
save(array $options = null, null $sessionKey = null)

Save the model to the database.

from  Model
bool
push(array $options = null, null $sessionKey = null)

Save the model and all of its relationships.

from  Model
bool
alwaysPush(array $options = null, string $sessionKey = null)

Pushes the first level of relations even if the parent model has no changes.

from  Model
void
performDeleteOnModel()

Perform the actual delete query on this model instance.

from  Model
void
performDeleteOnRelations()

Locates relations with delete flag and cascades the delete event.

from  Model
getName()

No description

getEmail()

No description

getTelephone()

No description

getDescription()

No description

getAddress()

No description

getReservationInterval()

No description

getReservationLeadTime()

No description

getReservationStayTime()

No description

getOrderTimeInterval($orderType)

No description

getOrderLeadTime($orderType)

No description

getOrderTimeRestriction($orderType)

No description

getOrderCancellationTimeout($orderType)

No description

getMinimumOrderTotal($orderType)

No description

deliveryMinutes()

No description

collectionMinutes()

No description

hasDelivery()

No description

hasCollection()

No description

hasFutureOrder($orderType = null)

No description

futureOrderDays($orderType = null)

No description

minimumFutureOrderDays($orderType = null)

No description

availableOrderTypes()

No description

static 
getOrderTypeOptions()

No description

calculateDistance(CoordinatesInterface $position)

No description

scopeSelectDistance($query, $latitude = null, $longitude = null)

No description

static 
bootHasWorkingHours()

No description

Carbon
getCurrentTime()

No description

availableWorkingTypes()

No description

listWorkingHours()

No description

mixed
workingHourType(null $hourType = null)

No description

getWorkingHoursByType($type)

No description

getWorkingHoursByDay($weekday)

No description

getWorkingHourByDayAndType($weekday, $type)

No description

getWorkingHourByDateAndType($date, $type)

No description

getWorkingHours()

No description

loadWorkingHours()

No description

newWorkingSchedule($type, $days = null)

No description

createScheduleItem($type)

No description

updateSchedule($type, $scheduleData)

No description

bool
addOpeningHours($type, array $data = [])

Create a new or update existing location working hours

parseHoursFromOptions($value)

No description

static 
bootHasDeliveryAreas()

No description

geocodeAddressOnSave()

No description

listDeliveryAreas()

No description

findDeliveryArea($areaId)

No description

getDistanceUnit()

No description

bool
addLocationAreas(array $deliveryAreas)

Create a new or update existing location areas

parseAreasFromOptions($value)

No description

static void
bootHasPermalink()

Boot the sortable trait for this model.

generatePermalinkOnSave()

Handle adding permalink slug on model update.

string
getSlugKeyName()

Primary slug column of this model.

string
getSlugKey()

Primary slug value of this model.

Builder
scopeWhereSlug($query, string $slug)

Query scope for finding a model by its primary slug.

Builder
scopeFindSimilarSlugs(Builder $query, string $attribute, array $config, string $slug)

Query scope for finding "similar" slugs, used to determine uniqueness.

findSlug($slug, $columns = ['*'])

No description

permalinkable()

No description

static 
bootHasMedia()

No description

from  HasMedia
mixed
media()

Set the polymorphic relation.

from  HasMedia
void
scopeWhereHasMedia(Builder $query, string|string[] $tags)

Query scope to detect the presence of one or more attached media for a given tag.

from  HasMedia
newMediaInstance()

No description

from  HasMedia
getDefaultTagName()

No description

from  HasMedia
string
getThumb(array $options = [], string $tag = null)

Get the thumbnail of the first media item of a default tag.

from  HasMedia
Collection
getMedia(string $tag = null, array|callable $filters = [])

Get a collection of media attachments by its tag.

from  HasMedia
Media|null
getFirstMedia(string $tag = null, array $filters = [])

Get the first media item of a media tag.

from  HasMedia
findMedia($mediaId)

No description

from  HasMedia
Collection
loadMedia($tag)

Lazy eager load attached media relationships.

from  HasMedia
bool
hasMedia(string $tag = null)

Determine if the specified tag contains media.

from  HasMedia
Collection
syncMedia(mixed $media, string $tag = null)

Replace the existing media collection for the specified tag(s).

from  HasMedia
void
deleteMedia(mixed $mediaId)

Detach a media item from the model.

from  HasMedia
deleteMediaExcept(mixed $media, string $tag = null)

Delete all media with the given tag except some.

from  HasMedia
void
clearMediaTag(string $tag = null)

Remove all media with the given tag.

from  HasMedia
prepareUnattachedMedia(Media $media, MediaAdder $mediaAdder)

No description

from  HasMedia
processUnattachedMedia(callable $callable)

No description

from  HasMedia
mediable()

No description

from  HasMedia
mediaWasLoaded()

No description

from  HasMedia
void
handleHasMediaDeletion()

Delete media relationships when the model is deleted. Ignore on soft deletes.

from  HasMedia
buildMediaPropertiesFilter(array $filters)

Convert the given array to a filter closure.

from  HasMedia
array
parseIds(mixed $value)

Get all of the IDs from the given mixed value.

from  HasMedia
static void
bootPurgeable()

Boot the purgeable trait for a model.

$this
addPurgeable(array|string|null $attributes = null)

Adds an attribute to the purgeable attributes list

array
purgeAttributes(null $attributesToPurge = null)

Removes purged attributes, used before saving.

getPurgeableAttributes()

Returns a collection of fields to be hashed.

getOriginalPurgeValues()

Returns the original values.

null
getOriginalPurgeValue($attribute)

Returns the original value of a single attribute.

restorePurgedValues()

Restores the original values.

static 
getDropdownOptions()

No description

static 
onboardingIsComplete()

No description

static 
addSortingColumns($newColumns)

No description

$this
scopeIsEnabled($query)

Scope a query to only include enabled location

scopeListFrontEnd($query, array $options = [])

No description

getLocationThumbAttribute()

No description

getDeliveryTimeAttribute($value)

No description

getCollectionTimeAttribute($value)

No description

getFutureOrdersAttribute($value)

No description

getReservationTimeIntervalAttribute($value)

No description

setOptionsAttribute($value)

No description

setUrl($suffix = null)

No description

hasGallery()

No description

getGallery()

No description

allowGuestOrder()

No description

listAvailablePayments()

No description

performAfterSave()

No description

makeDefault()

No description

static bool|null
updateDefault(string $locationId)

Update the default location

static 
getDefault()

No description

Details

in ExtendableTrait at line 55
extendableConstruct()

Constructor.

in ExtendableTrait at line 103
static void extendableExtendCallback(callable $callback)

Helper method for ::extend() static method

Parameters

callable $callback

Return Value

void

in ExtendableTrait at line 120
static void clearExtendedClasses()

Clear the list of extended classes so they will be re-extended.

Return Value

void

in ExtendableTrait at line 131
protected string extensionNormalizeClassName(string $name)

Normalizes the provided extension name allowing for the ClassLoader to inject aliased classes

Parameters

string $name

Return Value

string

in ExtendableTrait at line 149
void|ExtendableTrait extendClassWith(string $extensionName)

Dynamically extend a class with a specified behavior

Parameters

string $extensionName

Return Value

void|ExtendableTrait

Exceptions

Exception

in ExtendableTrait at line 178
protected void extensionExtractMethods(string $extensionName, object $extensionObject)

Extracts the available methods from a behavior and adds it to the list of callable methods.

Parameters

string $extensionName
object $extensionObject

Return Value

void

in ExtendableTrait at line 206
addDynamicMethod(string $dynamicName, callable $method, string $extension = null)

Programmatically adds a method to the extendable class

Parameters

string $dynamicName
callable $method
string $extension

in ExtendableTrait at line 225
addDynamicProperty(string $dynamicName, string $value = null)

Programatically adds a property to the extendable class

Parameters

string $dynamicName
string $value

in ExtendableTrait at line 249
bool isClassExtendedWith(string $name)

Check if extendable class is extended with a behavior object

Parameters

string $name

Fully qualified behavior name

Return Value

bool

in ExtendableTrait at line 265
mixed getClassExtension(string $name)

Returns a behavior object from an extendable class, example:

$this->getClassExtension('Admin.Actions.FormController')

Parameters

string $name

Fully qualified behavior name

Return Value

mixed

in ExtendableTrait at line 280
mixed asExtension(string $shortName)

Short hand for getClassExtension() method, except takes the short extension name, example:

$this->asExtension('FormController')

Parameters

string $shortName

Return Value

mixed

in ExtendableTrait at line 301
bool methodExists(string $name)

Checks if a method exists, extension equivalent of method_exists()

Parameters

string $name

Return Value

bool

in ExtendableTrait at line 313
array getClassMethods()

Get a list of class methods, extension equivalent of get_class_methods()

Return Value

array

in ExtendableTrait at line 326
array getDynamicProperties()

Returns all dynamic properties and their values

Return Value

array

['property' => 'value']

in ExtendableTrait at line 344
bool propertyExists(string $name)

Checks if a property exists, extension equivalent of property_exists()

Parameters

string $name

Return Value

bool

in ExtendableTrait at line 370
protected bool extendableIsAccessible(mixed $class, string $propertyName)

Checks if a property is accessible, property equivalent of is_callabe()

Parameters

mixed $class
string $propertyName

Return Value

bool

in ExtendableTrait at line 385
string extendableGet(string $name)

Magic method for __get()

Parameters

string $name

Return Value

string

in ExtendableTrait at line 410
string extendableSet(string $name, string $value)

Magic method for __set()

Parameters

string $name
string $value

Return Value

string

in ExtendableTrait at line 444
mixed extendableCall(string $name, array $params = null)

Magic method for __call()

Parameters

string $name
array $params

Return Value

mixed

in ExtendableTrait at line 483
static mixed extendableCallStatic(string $name, array $params = null)

Magic method for __callStatic()

Parameters

string $name
array $params

Return Value

mixed

in ExtendableTrait at line 552
protected ClassLoader|null extensionGetClassLoader()

Gets the class loader

Return Value

ClassLoader|null

in EventEmitter at line 36
EventEmitter bindEvent(string $event, callable $callback, int $priority = 0)

Create a new event binding.

Parameters

string $event

The event name to listen for

callable $callback

The callback to call when emitted

int $priority

Return Value

EventEmitter

in EventEmitter at line 52
EventEmitter bindEventOnce(string $event, callable $callback)

Create a new event binding that fires once only

Parameters

string $event

The event name

callable $callback

Return Value

EventEmitter

in EventEmitter at line 66
protected void emitterEventSortEvents(string $eventName)

Sort the listeners for a given event by priority.

Parameters

string $eventName

Return Value

void

in EventEmitter at line 84
EventEmitter unbindEvent(string $event = null)

Destroys an event binding.

Parameters

string $event

Event to destroy

Return Value

EventEmitter

in EventEmitter at line 124
string|array fireEvent(string $event, array $params = [], bool $halt = false)

Fire an event and call the listeners.

Parameters

string $event

Event name

array $params

Event parameters

bool $halt

Halt after first non-null result

Return Value

string|array

Collection of event results / Or single result (if halted)

in EventEmitter at line 178
mixed fireSystemEvent(string $event, array $params = [], bool $halt = true)

Fires a combination of local and global events. The first segment is removed from the event name locally and the local object is passed as the first argument to the event globally. Halting is also enabled by default.

For example:

$this->fireSystemEvent('admin.form.myEvent', ['my value']);

Is equivalent to:

$this->fireEvent('form.myEvent', ['myvalue'], true);

Event::fire('admin.form.myEvent', [$this, 'myvalue'], true);

Parameters

string $event

Event name

array $params

Event parameters

bool $halt

Halt after first non-null result

Return Value

mixed

in HasAttributes at line 19
void addCasts(array $attributes)

Add attribute casts for the model.

Parameters

array $attributes

Return Value

void

in HasAttributes at line 24
getAttribute($key)

No description

Parameters

$key

in HasAttributes at line 46
getAttributeValue($key)

No description

Parameters

$key

in HasAttributes at line 65
attributesToArray()

No description

in HasAttributes at line 111
HasAttributes setAttribute(string $key, mixed $value)

Set a given attribute on the model.

Parameters

string $key
mixed $value

Return Value

HasAttributes

in HasAttributes at line 170
protected asSerialized($value)

No description

Parameters

$value

in HasAttributes at line 175
fromSerialized($value)

No description

Parameters

$value

in HasAttributes at line 180
protected isSerializedCastable($key)

No description

Parameters

$key

in HasAttributes at line 185
protected asDateTime($value)

No description

Parameters

$value

in HasAttributes at line 197
protected asTime($value)

No description

Parameters

$value

in HasAttributes at line 242
string fromTime(Carbon|int $value)

Convert a Carbon Time to a storable string.

Parameters

Carbon|int $value

Return Value

string

in HasAttributes at line 259
protected bool isTimeCastable(string $key)

Determine whether a value is Time castable for inbound manipulation.

Parameters

string $key

Return Value

bool

in HasAttributes at line 268
protected string getTimeFormat()

Get the format for database stored times.

Return Value

string

in HasAttributes at line 280
HasAttributes setTimeFormat(string $format)

Set the time format used by the model.

Parameters

string $format

Return Value

HasAttributes

in HasRelationships at line 58
hasRelation($name)

No description

Parameters

$name

in HasRelationships at line 70
array getRelationDefinition(string $name)

Returns relationship details from a supplied name.

Parameters

string $name

Relation name

Return Value

array

in HasRelationships at line 81
array getRelationDefinitions()

Returns relationship details for all relations defined on this model.

Return Value

array

in HasRelationships at line 108
string getRelationType(string $name)

Returns a relationship type based on a supplied name.

Parameters

string $name

Relation name

Return Value

string

in HasRelationships at line 124
mixed getRelationValue(string $key)

Get a relationship.

Parameters

string $key

Return Value

mixed

in HasRelationships at line 141
protected $this setRelationValue($relationName, $value)

Sets a relation value directly from its attribute.

Parameters

$relationName
$value

Return Value

$this

in HasRelationships at line 155
string makeRelation(string $name)

Returns a relation class object

Parameters

string $name

Relation name

Return Value

string

in HasRelationships at line 177
bool isRelationPushable(string $name)

Determines whether the specified relation should be saved when push() is called instead of save() on the model. Default: true.

Parameters

string $name

Relation name

Return Value

bool

in HasRelationships at line 194
protected array getRelationDefaults(string $type)

Returns default relation arguments for a given type.

Parameters

string $type

Relation type

Return Value

array

in HasRelationships at line 206
handleRelation($relationName)

No description

Parameters

$relationName

in HasRelationships at line 334
protected array validateRelationArgs($relationName, $optional, array $required = [])

Validate relation supplied arguments.

Parameters

$relationName
$optional
array $required

Return Value

array

in HasRelationships at line 374
HasOne hasOne(string $related, string|null $foreignKey = null, string|null $localKey = null, null $relationName = null)

Define a one-to-one relationship.

Parameters

string $related
string|null $foreignKey
string|null $localKey
null $relationName

Return Value

HasOne

in HasRelationships at line 398
HasOneThrough hasOneThrough($related, $through, $primaryKey = null, $throughKey = null, $localKey = null, $secondLocalKey = null, $relationName = null)

Define a has-one-through relationship.

This code is a duplicate of Eloquent but uses a Rain relation class.

Parameters

$related
$through
$primaryKey
$throughKey
$localKey
$secondLocalKey
$relationName

Return Value

HasOneThrough

in HasRelationships at line 428
HasMany hasMany(string $related, string|null $foreignKey = null, string|null $localKey = null, null $relationName = null)

Define a one-to-many relationship.

Parameters

string $related
string|null $foreignKey
string|null $localKey
null $relationName

Return Value

HasMany

in HasRelationships at line 459
HasManyThrough hasManyThrough(string $related, string $through, string|null $firstKey = null, string|null $secondKey = null, string|null $localKey = null, string|null $secondLocalKey = null, null $relationName = null)

Define a has-many-through relationship.

Parameters

string $related
string $through
string|null $firstKey
string|null $secondKey
string|null $localKey
string|null $secondLocalKey
null $relationName

Return Value

HasManyThrough

in HasRelationships at line 487
belongsTo($related, $foreignKey = null, $ownerKey = null, $relationName = null)

No description

Parameters

$related
$foreignKey
$ownerKey
$relationName

in HasRelationships at line 508
belongsToMany($related, $table = null, $foreignPivotKey = null, $relatedPivotKey = null, $parentKey = null, $relatedKey = null, $relationName = null)

No description

Parameters

$related
$table
$foreignPivotKey
$relatedPivotKey
$parentKey
$relatedKey
$relationName

in HasRelationships at line 541
MorphOne morphOne(string $related, string $name, string|null $type = null, string|null $id = null, string|null $localKey = null, null $relationName = null)

Define a polymorphic one-to-one relationship.

Parameters

string $related
string $name
string|null $type
string|null $id
string|null $localKey
null $relationName

Return Value

MorphOne

in HasRelationships at line 572
protected MorphTo morphEagerTo(string $name, string $type, string $id, $ownerKey)

Define a polymorphic, inverse one-to-one or many relationship.

Parameters

string $name
string $type
string $id
$ownerKey

Return Value

MorphTo

in HasRelationships at line 594
protected MorphTo morphInstanceTo(string $target, string $name, string $type, string $id, $ownerKey)

Define a polymorphic, inverse one-to-one or many relationship.

Parameters

string $target
string $name
string $type
string $id
$ownerKey

Return Value

MorphTo

in HasRelationships at line 621
MorphMany morphMany(string $related, string $name, string|null $type = null, string|null $id = null, string|null $localKey = null, null $relationName = null)

Define a polymorphic one-to-many relationship.

Parameters

string $related
string $name
string|null $type
string|null $id
string|null $localKey
null $relationName

Return Value

MorphMany

in HasRelationships at line 657
MorphToMany morphToMany(string $related, string $name, string|null $table = null, string|null $foreignPivotKey = null, string|null $relatedPivotKey = null, string|null $parentKey = null, string|null $relatedKey = null, bool $inverse = false, null $relationName = null)

Define a polymorphic many-to-many relationship.

Parameters

string $related
string $name
string|null $table
string|null $foreignPivotKey
string|null $relatedPivotKey
string|null $parentKey
string|null $relatedKey
bool $inverse
null $relationName

Return Value

MorphToMany

in HasRelationships at line 705
MorphToMany morphedByMany(string $related, string $name, string|null $table = null, string|null $foreignPivotKey = null, string|null $relatedPivotKey = null, string|null $parentKey = null, string|null $relatedKey = null, null $relationName = null)

Define a polymorphic, inverse many-to-many relationship.

Parameters

string $related
string $name
string|null $table
string|null $foreignPivotKey
string|null $relatedPivotKey
string|null $parentKey
string|null $relatedKey
null $relationName

Return Value

MorphToMany

in Model at line 88
__construct(array $attributes = [])

No description

Parameters

array $attributes

in Model at line 103
static Model|Model make(array $attributes = [])

Create a new model and return the instance.

Parameters

array $attributes

Return Value

Model|Model

in Model at line 117
static Model|Model create(array $attributes = [], string $sessionKey = null)

Save a new model and return the instance.

Parameters

array $attributes
string $sessionKey

Return Value

Model|Model

Exceptions

Exception

in Model at line 129
Model|Model reload()

Reloads the model attributes from the database.

Return Value

Model|Model

in Model at line 148
void reloadRelations(string $relationName = null)

Reloads the model relationship cache.

Parameters

string $relationName

Return Value

void

in Model at line 163
static extend(Closure $callback)

Extend this object properties upon construction.

Parameters

Closure $callback

in Model at line 171
protected bootNicerEvents()

Bind some nicer events to this model, in the format of method overrides.

in Model at line 214
static void flushEventListeners()

Remove all of the event listeners for the model Also flush registry of models that had events booted Allows painless unit testing.

Return Value

void

in Model at line 229
Model|Model newFromBuilder(array $attributes = [], null $connection = null)

Create a new model instance that is existing.

Parameters

array $attributes
null $connection

Return Value

Model|Model

in Model at line 248
protected beforeCreate()

Handle the "creating" model event

in Model at line 255
protected afterCreate()

Handle the "created" model event

in Model at line 262
protected beforeUpdate()

Handle the "updating" model event

in Model at line 269
protected afterUpdate()

Handle the "updated" model event

in Model at line 276
protected beforeSave()

Handle the "saving" model event

at line 114
protected afterSave()

Handle the "saved" model event

at line 110
protected beforeDelete()

Handle the "deleting" model event

in Model at line 297
protected afterDelete()

Handle the "deleted" model event

in Model at line 304
protected beforeFetch()

Handle the "fetching" model event

in Model at line 311
protected afterFetch()

Handle the "fetched" model event

in Model at line 322
static void fetching(Closure|string $callback)

Create a new native event for handling beforeFetch().

Parameters

Closure|string $callback

Return Value

void

in Model at line 334
static void fetched(Closure|string $callback)

Create a new native event for handling afterFetch().

Parameters

Closure|string $callback

Return Value

void

in Model at line 339
setUpdatedAt($value)

No description

Parameters

$value

in Model at line 347
setCreatedAt($value)

No description

Parameters

$value

in Model at line 363
array getObservableEvents()

Get the observable event names.

Return Value

array

in Model at line 375
protected isRelationPurgeable($name)

No description

Parameters

$name

in Model at line 391
Builder newEloquentBuilder(Builder $query)

Create a new Eloquent query builder for the model.

Parameters

Builder $query

Return Value

Builder

in Model at line 400
string getForeignKey()

Get the default foreign key name for the model.

Return Value

string

in Model at line 409
__get($key)

No description

Parameters

$key

in Model at line 414
__set($name, $value)

No description

Parameters

$name
$value

in Model at line 427
mixed __call(string $method, $params)

Handle dynamic method calls into the model.

Parameters

string $method
$params

Return Value

mixed

in Model at line 448
Pivot newPivot(Model $parent, array $attributes, string $table, bool $exists, string|null $using = null)

Create a generic pivot model instance.

Parameters

Model $parent
array $attributes
string $table
bool $exists
string|null $using

Return Value

Pivot

in Model at line 464
Pivot newRelationPivot(string $relationName, Model $parent, array $attributes, string $table, bool $exists)

Create a pivot model instance specific to a relation.

Parameters

string $relationName
Model $parent
array $attributes
string $table
bool $exists

Return Value

Pivot

in Model at line 487
protected bool saveInternal(array $options = [])

Save the model to the database. Is used by save()

Parameters

array $options

Return Value

bool

Exceptions

Exception

in Model at line 521
bool save(array $options = null, null $sessionKey = null)

Save the model to the database.

Parameters

array $options
null $sessionKey

Return Value

bool

Exceptions

Exception

in Model at line 535
bool push(array $options = null, null $sessionKey = null)

Save the model and all of its relationships.

Parameters

array $options
null $sessionKey

Return Value

bool

Exceptions

Exception

in Model at line 577
bool alwaysPush(array $options = null, string $sessionKey = null)

Pushes the first level of relations even if the parent model has no changes.

Parameters

array $options
string $sessionKey

Return Value

bool

in Model at line 586
protected void performDeleteOnModel()

Perform the actual delete query on this model instance.

Return Value

void

in Model at line 596
protected void performDeleteOnRelations()

Locates relations with delete flag and cascades the delete event.

Return Value

void

in AbstractLocation at line 44
getName()

No description

in AbstractLocation at line 49
getEmail()

No description

in AbstractLocation at line 54
getTelephone()

No description

in AbstractLocation at line 59
getDescription()

No description

at line 245
getAddress()

No description

in AbstractLocation at line 78
getReservationInterval()

No description

in AbstractLocation at line 83
getReservationLeadTime()

No description

in AbstractLocation at line 88
getReservationStayTime()

No description

in AbstractLocation at line 93
getMinReservationAdvanceTime()

No description

in AbstractLocation at line 98
getMaxReservationAdvanceTime()

No description

in AbstractLocation at line 103
getReservationCancellationTimeout()

No description

in AbstractLocation at line 108
getOrderTimeInterval($orderType)

No description

Parameters

$orderType

in AbstractLocation at line 113
getOrderLeadTime($orderType)

No description

Parameters

$orderType

in AbstractLocation at line 118
getOrderTimeRestriction($orderType)

No description

Parameters

$orderType

in AbstractLocation at line 123
getOrderCancellationTimeout($orderType)

No description

Parameters

$orderType

in AbstractLocation at line 128
getMinimumOrderTotal($orderType)

No description

Parameters

$orderType

in AbstractLocation at line 133
deliveryMinutes()

No description

in AbstractLocation at line 138
collectionMinutes()

No description

in AbstractLocation at line 143
hasDelivery()

No description

in AbstractLocation at line 148
hasCollection()

No description

in AbstractLocation at line 153
hasFutureOrder($orderType = null)

No description

Parameters

$orderType

in AbstractLocation at line 160
futureOrderDays($orderType = null)

No description

Parameters

$orderType

in AbstractLocation at line 167
minimumFutureOrderDays($orderType = null)

No description

Parameters

$orderType

in AbstractLocation at line 174
availableOrderTypes()

No description

in AbstractLocation at line 179
static getOrderTypeOptions()

No description

in AbstractLocation at line 184
calculateDistance(CoordinatesInterface $position)

No description

Parameters

CoordinatesInterface $position

in AbstractLocation at line 198
Coordinates getCoordinates()

No description

Return Value

Coordinates

in AbstractLocation at line 206
DistanceInterface makeDistance()

No description

Return Value

DistanceInterface

in AbstractLocation at line 215
scopeSelectDistance($query, $latitude = null, $longitude = null)

No description

Parameters

$query
$latitude
$longitude

in HasWorkingHours at line 16
static bootHasWorkingHours()

No description

in HasWorkingHours at line 38
Carbon getCurrentTime()

No description

Return Value

Carbon

in HasWorkingHours at line 43
availableWorkingTypes()

No description

in HasWorkingHours at line 50
listWorkingHours()

No description

in HasWorkingHours at line 60
mixed workingHourType(null $hourType = null)

No description

Parameters

null $hourType

Return Value

mixed

24_7, daily or flexible

in HasWorkingHours at line 65
getWorkingHoursByType($type)

No description

Parameters

$type

in HasWorkingHours at line 70
getWorkingHoursByDay($weekday)

No description

Parameters

$weekday

in HasWorkingHours at line 75
getWorkingHourByDayAndType($weekday, $type)

No description

Parameters

$weekday
$type

in HasWorkingHours at line 83
getWorkingHourByDateAndType($date, $type)

No description

Parameters

$date
$type

in HasWorkingHours at line 93
getWorkingHours()

No description

in HasWorkingHours at line 108
loadWorkingHours()

No description

in HasWorkingHours at line 113
newWorkingSchedule($type, $days = null)

No description

Parameters

$type
$days

in HasWorkingHours at line 140
createScheduleItem($type)

No description

Parameters

$type

in HasWorkingHours at line 150
updateSchedule($type, $scheduleData)

No description

Parameters

$type
$scheduleData

in HasWorkingHours at line 168
bool addOpeningHours($type, array $data = [])

Create a new or update existing location working hours

Parameters

$type
array $data

Return Value

bool

in HasWorkingHours at line 203
protected parseHoursFromOptions($value)

No description

Parameters

$value

in HasWorkingHours at line 238
protected createDefaultWorkingHours()

No description

in HasDeliveryAreas at line 15
static bootHasDeliveryAreas()

No description

in HasDeliveryAreas at line 36
protected geocodeAddressOnSave()

No description

in HasDeliveryAreas at line 59
listDeliveryAreas()

No description

in HasDeliveryAreas at line 69
AreaInterface|null findDeliveryArea($areaId)

No description

Parameters

$areaId

Return Value

AreaInterface|null

in HasDeliveryAreas at line 78
AreaInterface|null searchOrDefaultDeliveryArea(CoordinatesInterface $coordinates)

No description

Parameters

CoordinatesInterface $coordinates

Return Value

AreaInterface|null

in HasDeliveryAreas at line 90
AreaInterface|null searchOrFirstDeliveryArea(CoordinatesInterface $coordinates)

No description

Parameters

CoordinatesInterface $coordinates

Return Value

AreaInterface|null

in HasDeliveryAreas at line 102
AreaInterface|null searchDeliveryArea(CoordinatesInterface $coordinates)

No description

Parameters

CoordinatesInterface $coordinates

Return Value

AreaInterface|null

in HasDeliveryAreas at line 114
getDistanceUnit()

No description

in HasDeliveryAreas at line 130
bool addLocationAreas(array $deliveryAreas)

Create a new or update existing location areas

Parameters

array $deliveryAreas

Return Value

bool

in HasDeliveryAreas at line 154
protected parseAreasFromOptions($value)

No description

Parameters

$value

Boot the sortable trait for this model.

Return Value

void

Exceptions

Exception

in HasPermalink at line 41
protected generatePermalinkOnSave()

Handle adding permalink slug on model update.

in HasPermalink at line 50
string getSlugKeyName()

Primary slug column of this model.

Return Value

string

in HasPermalink at line 72
string getSlugKey()

Primary slug value of this model.

Return Value

string

in HasPermalink at line 85
Builder scopeWhereSlug($query, string $slug)

Query scope for finding a model by its primary slug.

Parameters

$query
string $slug

Return Value

Builder

in HasPermalink at line 100
Builder scopeFindSimilarSlugs(Builder $query, string $attribute, array $config, string $slug)

Query scope for finding "similar" slugs, used to determine uniqueness.

Parameters

Builder $query
string $attribute
array $config
string $slug

Return Value

Builder

in HasPermalink at line 108
findSlug($slug, $columns = ['*'])

No description

Parameters

$slug
$columns

in HasPermalink at line 113
permalinkable()

No description

in HasPermalink at line 132
protected PermalinkMaker getPermalinkMaker()

No description

Return Value

PermalinkMaker

in HasMedia at line 20
static bootHasMedia()

No description

in HasMedia at line 32
mixed media()

Set the polymorphic relation.

Return Value

mixed

in HasMedia at line 43
void scopeWhereHasMedia(Builder $query, string|string[] $tags)

Query scope to detect the presence of one or more attached media for a given tag.

Parameters

Builder $query
string|string[] $tags

Return Value

void

in HasMedia at line 53
newMediaInstance()

No description

in HasMedia at line 84
getDefaultTagName()

No description

in HasMedia at line 100
string getThumb(array $options = [], string $tag = null)

Get the thumbnail of the first media item of a default tag.

Parameters

array $options
string $tag

Return Value

string

in HasMedia at line 113
Collection getMedia(string $tag = null, array|callable $filters = [])

Get a collection of media attachments by its tag.

Parameters

string $tag
array|callable $filters

Return Value

Collection

in HasMedia at line 131
Media|null getFirstMedia(string $tag = null, array $filters = [])

Get the first media item of a media tag.

Parameters

string $tag
array $filters

Return Value

Media|null

in HasMedia at line 136
findMedia($mediaId)

No description

Parameters

$mediaId

in HasMedia at line 154
Collection loadMedia($tag)

Lazy eager load attached media relationships.

Parameters

$tag

Return Value

Collection

in HasMedia at line 172
bool hasMedia(string $tag = null)

Determine if the specified tag contains media.

Parameters

string $tag

Return Value

bool

in HasMedia at line 185
Collection syncMedia(mixed $media, string $tag = null)

Replace the existing media collection for the specified tag(s).

Parameters

mixed $media
string $tag

Return Value

Collection

in HasMedia at line 211
void deleteMedia(mixed $mediaId)

Detach a media item from the model.

Parameters

mixed $mediaId

Return Value

void

in HasMedia at line 228
protected deleteMediaExcept(mixed $media, string $tag = null)

Delete all media with the given tag except some.

Parameters

mixed $media
string $tag

in HasMedia at line 244
void clearMediaTag(string $tag = null)

Remove all media with the given tag.

Parameters

string $tag

Return Value

void

in HasMedia at line 254
prepareUnattachedMedia(Media $media, MediaAdder $mediaAdder)

No description

Parameters

Media $media
MediaAdder $mediaAdder

in HasMedia at line 259
processUnattachedMedia(callable $callable)

No description

Parameters

callable $callable

in HasMedia at line 268
mediable()

No description

in HasMedia at line 284
protected mediaWasLoaded()

No description

in HasMedia at line 293
protected void handleHasMediaDeletion()

Delete media relationships when the model is deleted. Ignore on soft deletes.

Return Value

void

in HasMedia at line 307
protected Closure buildMediaPropertiesFilter(array $filters)

Convert the given array to a filter closure.

Parameters

array $filters

Return Value

Closure

in HasMedia at line 328
protected array parseIds(mixed $value)

Get all of the IDs from the given mixed value.

Parameters

mixed $value

Return Value

array

in Purgeable at line 32
static void bootPurgeable()

Boot the purgeable trait for a model.

Return Value

void

Exceptions

Exception

in Purgeable at line 56
$this addPurgeable(array|string|null $attributes = null)

Adds an attribute to the purgeable attributes list

Parameters

array|string|null $attributes

Return Value

$this

in Purgeable at line 72
array purgeAttributes(null $attributesToPurge = null)

Removes purged attributes, used before saving.

Parameters

null $attributesToPurge

Return Value

array

Clean attributes

in Purgeable at line 98
getPurgeableAttributes()

Returns a collection of fields to be hashed.

in Purgeable at line 106
getOriginalPurgeValues()

Returns the original values.

in Purgeable at line 118
null getOriginalPurgeValue($attribute)

Returns the original value of a single attribute.

Parameters

$attribute

Return Value

null

in Purgeable at line 128
restorePurgedValues()

Restores the original values.

at line 81
static getDropdownOptions()

No description

at line 86
static onboardingIsComplete()

No description

at line 101
static addSortingColumns($newColumns)

No description

Parameters

$newColumns

at line 128
$this scopeIsEnabled($query)

Scope a query to only include enabled location

Parameters

$query

Return Value

$this

at line 133
scopeListFrontEnd($query, array $options = [])

No description

Parameters

$query
array $options

at line 200
getLocationThumbAttribute()

No description

at line 205
getDeliveryTimeAttribute($value)

No description

Parameters

$value

at line 210
getCollectionTimeAttribute($value)

No description

Parameters

$value

at line 215
getFutureOrdersAttribute($value)

No description

Parameters

$value

at line 220
getReservationTimeIntervalAttribute($value)

No description

Parameters

$value

at line 225
setOptionsAttribute($value)

No description

Parameters

$value

at line 237
setUrl($suffix = null)

No description

Parameters

$suffix

at line 257
hasGallery()

No description

at line 262
getGallery()

No description

at line 270
allowGuestOrder()

No description

at line 278
listAvailablePayments()

No description

at line 294
performAfterSave()

No description

at line 302
makeDefault()

No description

at line 320
static bool|null updateDefault(string $locationId)

Update the default location

Parameters

string $locationId

Return Value

bool|null

at line 329
static getDefault()

No description