Customer
class Customer extends BaseModel (View source)
Traits
Properties
protected array | $additionalSearchFields | Define the additional fields we want to index. |
from Searchable |
protected array | $additionalFilterableFields | Define the additional filterable fields. |
from Searchable |
protected array | $additionalSortableFields | Define the additional sortable fields. |
from Searchable |
protected array | $filterable | Define our base filterable attributes. |
|
protected array | $sortable | Define our base sortable attributes. |
|
protected array | $guarded | Define the guarded attributes. |
|
protected | $casts | {@inheritDoc} | |
int | $id | ||
?string | $title | ||
string | $first_name | ||
string | $last_name | ||
?string | $company_name | ||
?string | $vat_no | ||
?string | $account_ref | ||
?array | $attribute_data | ||
?array | $meta | ||
Carbon | $created_at | ||
Carbon | $updated_at |
Methods
Get new instance of the registered model.
Handle dynamic and static method calls into the model.
Forward a method call to the model only when calling a method on the model.
Register a model event with the dispatcher.
Fire the given event for the model.
Remove all the event listeners for the model.
Getter to return the class name used with attribute relationships.
Get the mapped attributes relation.
Translate a given attribute based on passed locale.
Translate a value from attribute data.
{@inheritDoc}
Add an attribute into the additional searchable fields.
Handle dynamic static method calls into the model.
Return a new factory instance for the model.
Get the name of the index associated with the model.
Return the customer group relationship.
Return the customer group relationship.
Return the addresses relationship.
No description
Details
Model
newInstance(array $attributes = [], bool $exists = false)
Get new instance of the registered model.
mixed
__call(string $method, array $parameters)
Handle dynamic and static method calls into the model.
Model
swap(string $newModelClass)
Swap the model implementation.
string
getMorphClass()
Get the class name of the base model.
protected bool
forwardCallsWhen(string $method, Model $model)
Forward a method call to the model only when calling a method on the model.
static protected void
registerModelEvent(string $event, QueuedClosure|Closure|string $callback)
Register a model event with the dispatcher.
protected mixed
fireModelEvent(string $event, bool $halt = true)
Fire the given event for the model.
static void
flushEventListeners()
Remove all the event listeners for the model.
__construct(array $attributes = [])
Create a new instance of the Model.
string
getAttributableClassnameAttribute()
Getter to return the class name used with attribute relationships.
MorphToMany
mappedAttributes()
Get the mapped attributes relation.
string
getFullNameAttribute()
Return the full name of the customer.
string
translate(string $attribute, string $locale = null)
Translate a given attribute based on passed locale.
string
translateAttribute(string $attribute, string $locale = null)
Translate a value from attribute data.
void
attr(...$params)
Shorthand to translate an attribute.
getSearchableAttributes()
{@inheritDoc}
array
getFilterableAttributes()
Return our base attributes we want filterable.
void
addFilterableAttributes(array $attributes)
Add additional fields to filter on.
void
addSortableAttributes(array $attributes)
Add additional sortable attributes.
array
getSortableAttributes()
Return our base attributes we want sortable.
getObservableEvents()
{@inheritDoc}
void
addSearchableAttribute(string $key, string|mixed $value)
Add an attribute into the additional searchable fields.
toSearchableArray()
{@inheritDoc}
searchableUsing()
{@inheritDoc}
static mixed
__callStatic(string $method, array $parameters)
Handle dynamic static method calls into the model.
static protected CustomerFactory
newFactory()
Return a new factory instance for the model.
string
searchableAs()
Get the name of the index associated with the model.
BelongsToMany
customerGroups()
Return the customer group relationship.
BelongsToMany
users()
Return the customer group relationship.
HasMany
addresses()
Return the addresses relationship.
orders()
No description