class DatabaseNotification extends Model (View source)

Traits

Properties

static protected Builder $builder

The query builder instance

from  Model
protected array $hidden

The hidden field

from  Model
protected bool $timestamps

Enable the timestamps support

from  Model
protected string $prefix

Define the table prefix

from  Model
protected bool $auto_increment

Enable the autoincrement support

from  Model
protected bool $soft_delete

Enable the soft deletion

from  Model
protected string $latest

Defines the column where the query construct will use for the last query

from  Model
protected string $created_at

Defines the created_at column name

from  Model
protected string $updated_at

Defines the created_at column name

from  Model
protected array $attributes

The table columns listing

from  Model
protected array $dates

The date mutation

from  Model
protected array|string[] $casts

Cast data as json

protected string $primary_key

The table primary key column name

from  Model
protected string $primary_key_type

The table primary key type

from  Model
protected string $table

The table name

protected ?string $connection

The connection name

from  Model

Methods

belongsTo(string $related, string|null $foreign_key = null, string|null $local_key = null)

The has one relative

string
getKey()

Get the table key

belongsToMany(string $related, string|null $primary_key = null, string|null $foreign_key = null)

The belongs to many relative

hasMany(string $related, string|null $primary_key = null, string|null $foreign_key = null)

The has many relative

hasOne(string $related, string|null $foreign_key = null, string|null $primary_key = null)

The has one relative

void
offsetSet(mixed $offset, mixed $value)

_offsetSet

bool
offsetExists(mixed $offset)

_offsetExists

void
offsetUnset(mixed $offset)

_offsetUnset

mixed
offsetGet(mixed $offset)

_offsetGet

array
__serialize()

Serialize model

void
__unserialize(array $attributes)

Unserialize

__construct(array $attributes = [])

Model constructor.

string
getTable()

Get the table name.

from  Model
static Builder
query()

Initialize the connection

from  Model
static Model
connection(string $name)

Set the connection

from  Model
setConnection(string $name)

Set connection point

from  Model
static Collection
all(array $columns = [])

Get all records

from  Model
static Model|null
latest()

Get latest

from  Model
static array|object|null
first()

Get first rows

from  Model
static Collection
retrieveBy(string $column, mixed $value)

retrieve by column name

from  Model
static Model|null
retrieveAndDelete(int|string|array $id, array $select = ['*'])

retrieve information and delete it

from  Model
static array|object|null
retrieve(int|string|array $id, array $select = ['*'])

retrieve

from  Model
int
delete()

Delete a record

from  Model
mixed
getKeyValue()

Retrieves the primary key value

from  Model
static array|object
retrieveOrFail(int|string $id, array $select = ['*'])

retrieve information by id or throws an exception in data box not found

from  Model
static Model
create(array $data)

Create a persist information

from  Model
int
persist()

persist aliases on insert action

from  Model
int|bool
update(array $attributes)

Delete a record

from  Model
static Pagination
paginate(int $page_number, int $current = 0, int|null $chunk = null)

Pagination configuration

from  Model
static void
deleted(callable $cb)

Allows to associate listener

from  Model
static void
deleting(callable $cb)

Allows to associate listener

from  Model
static void
creating(callable $cb)

Allows to associate a listener

from  Model
static void
created(callable $cb)

Allows to associate a listener

from  Model
static void
updating(callable $cb)

Allows to associate a listener

from  Model
static void
updated(callable $cb)

Allows to associate a listener

from  Model
static int
deleteBy(string $column, mixed $value)

Delete Active Record by column name

from  Model
static mixed
__callStatic(string $name, array $arguments)

__callStatic

from  Model
string
getKeyType()

Retrieves the primary key

from  Model
bool
touch()

Used to update the timestamp.

from  Model
void
setAttribute(string $key, string $value)

Assign a value

from  Model
array
getAttributes()

Retrieves the list of attributes.

from  Model
void
setAttributes(array $attributes)

Assign values to class attributes

from  Model
mixed
getAttribute(string $key)

Allows you to recover an attribute

from  Model
array
toArray()

Returns the data

from  Model
array
jsonSerialize()

No description

from  Model
mixed
__get(string $name)

__get

from  Model
__set(string $name, mixed $value)

__set

from  Model
string
__toString()

__toString

from  Model
string
toJson()

Returns the data

from  Model
mixed
__call(string $name, array $arguments = [])

__call

from  Model
void
select(array|string[] $select)

No description

from  Model
void
whereIn(string $primary_key, array $id)

No description

from  Model
void
get()

No description

from  Model
void
where(string $column, mixed $value)

No description

from  Model
void
orderBy(string $latest, string $string)

No description

from  Model
bool|int
markAsRead()

Mark notification as read

Details

BelongsTo belongsTo(string $related, string|null $foreign_key = null, string|null $local_key = null)

The has one relative

Parameters

string $related
string|null $foreign_key
string|null $local_key

Return Value

BelongsTo

abstract string getKey()

Get the table key

Return Value

string

BelongsToMany belongsToMany(string $related, string|null $primary_key = null, string|null $foreign_key = null)

The belongs to many relative

Parameters

string $related
string|null $primary_key
string|null $foreign_key

Return Value

BelongsToMany

HasMany hasMany(string $related, string|null $primary_key = null, string|null $foreign_key = null)

The has many relative

Parameters

string $related
string|null $primary_key
string|null $foreign_key

Return Value

HasMany

Exceptions

QueryBuilderException

HasOne hasOne(string $related, string|null $foreign_key = null, string|null $primary_key = null)

The has one relative

Parameters

string $related
string|null $foreign_key
string|null $primary_key

Return Value

HasOne

void offsetSet(mixed $offset, mixed $value)

_offsetSet

Parameters

mixed $offset
mixed $value

Return Value

void

See also

http://php.net/manual/fr/class.arrayaccess.php

bool offsetExists(mixed $offset)

_offsetExists

Parameters

mixed $offset

Return Value

bool

See also

http://php.net/manual/fr/class.arrayaccess.php

void offsetUnset(mixed $offset)

_offsetUnset

Parameters

mixed $offset

Return Value

void

See also

http://php.net/manual/fr/class.arrayaccess.php

mixed offsetGet(mixed $offset)

_offsetGet

Parameters

mixed $offset

Return Value

mixed

See also

http://php.net/manual/fr/class.arrayaccess.php

array __serialize()

Serialize model

Return Value

array

void __unserialize(array $attributes)

Unserialize

Parameters

array $attributes

Return Value

void

__construct(array $attributes = [])

Model constructor.

Parameters

array $attributes

string getTable()

Get the table name.

Return Value

string

static Builder query()

Initialize the connection

Return Value

Builder

Exceptions

static Model connection(string $name)

Set the connection

Parameters

string $name

Return Value

Model

Exceptions

ConnectionException

Builder setConnection(string $name)

Set connection point

Parameters

string $name

Return Value

Builder

Exceptions

ConnectionException

static Collection all(array $columns = [])

Get all records

Parameters

array $columns

Return Value

Collection

static Model|null latest()

Get latest

Return Value

Model|null

static array|object|null first()

Get first rows

Return Value

array|object|null

static Collection retrieveBy(string $column, mixed $value)

retrieve by column name

Parameters

string $column
mixed $value

Return Value

Collection

static Model|null retrieveAndDelete(int|string|array $id, array $select = ['*'])

retrieve information and delete it

Parameters

int|string|array $id
array $select

Return Value

Model|null

static array|object|null retrieve(int|string|array $id, array $select = ['*'])

retrieve

Parameters

int|string|array $id
array $select

Return Value

array|object|null

int delete()

Delete a record

Return Value

int

Exceptions

mixed getKeyValue()

Retrieves the primary key value

Return Value

mixed

static array|object retrieveOrFail(int|string $id, array $select = ['*'])

retrieve information by id or throws an exception in data box not found

Parameters

int|string $id
array $select

Return Value

array|object

Exceptions

NotFoundException

static Model create(array $data)

Create a persist information

Parameters

array $data

Return Value

Model

int persist()

persist aliases on insert action

Return Value

int

Exceptions

int|bool update(array $attributes)

Delete a record

Parameters

array $attributes

Return Value

int|bool

Exceptions

static Pagination paginate(int $page_number, int $current = 0, int|null $chunk = null)

Pagination configuration

Parameters

int $page_number
int $current
int|null $chunk

Return Value

Pagination

static void deleted(callable $cb)

Allows to associate listener

Parameters

callable $cb

Return Value

void

Exceptions

static void deleting(callable $cb)

Allows to associate listener

Parameters

callable $cb

Return Value

void

Exceptions

static void creating(callable $cb)

Allows to associate a listener

Parameters

callable $cb

Return Value

void

Exceptions

static void created(callable $cb)

Allows to associate a listener

Parameters

callable $cb

Return Value

void

Exceptions

static void updating(callable $cb)

Allows to associate a listener

Parameters

callable $cb

Return Value

void

Exceptions

static void updated(callable $cb)

Allows to associate a listener

Parameters

callable $cb

Return Value

void

Exceptions

static int deleteBy(string $column, mixed $value)

Delete Active Record by column name

Parameters

string $column
mixed $value

Return Value

int

Exceptions

QueryBuilderException

static mixed __callStatic(string $name, array $arguments)

__callStatic

Parameters

string $name
array $arguments

Return Value

mixed

string getKeyType()

Retrieves the primary key

Return Value

string

bool touch()

Used to update the timestamp.

Return Value

bool

void setAttribute(string $key, string $value)

Assign a value

Parameters

string $key
string $value

Return Value

void

array getAttributes()

Retrieves the list of attributes.

Return Value

array

void setAttributes(array $attributes)

Assign values to class attributes

Parameters

array $attributes

Return Value

void

mixed getAttribute(string $key)

Allows you to recover an attribute

Parameters

string $key

Return Value

mixed

array toArray()

Returns the data

Return Value

array

array jsonSerialize()

No description

Return Value

array

mixed __get(string $name)

__get

Parameters

string $name

Return Value

mixed

__set(string $name, mixed $value)

__set

Parameters

string $name
mixed $value

string __toString()

__toString

Return Value

string

string toJson()

Returns the data

Return Value

string

mixed __call(string $name, array $arguments = [])

__call

Parameters

string $name
array $arguments

Return Value

mixed

void select(array|string[] $select)

No description

Parameters

array|string[] $select

Return Value

void

void whereIn(string $primary_key, array $id)

No description

Parameters

string $primary_key
array $id

Return Value

void

void get()

No description

Return Value

void

void where(string $column, mixed $value)

No description

Parameters

string $column
mixed $value

Return Value

void

void orderBy(string $latest, string $string)

No description

Parameters

string $latest
string $string

Return Value

void

bool|int markAsRead()

Mark notification as read

Return Value

bool|int