PHP Class Corcel\Options

Author: José CI ([email protected])
Inheritance: extends Illuminate\Database\Eloquent\Model
Show file Open project: jgrossi/corcel Class Usage Examples

Protected Properties

Property Type Description
$appends array The accessors to append to the model's array form.
$fillable array The attributes that are mass assignable.
$primaryKey string The primary key of the model.
$table string The database table used by the model.

Public Methods

Method Description
get ( string $name ) : string | array Gets option field by its name.
getAll ( ) : array Gets all the options.
getValueAttribute ( ) : value Gets the value.

Method Details

get() public static method

Gets option field by its name.
public static get ( string $name ) : string | array
$name string
return string | array

getAll() public static method

Gets all the options.
public static getAll ( ) : array
return array

getValueAttribute() public method

Tries to unserialize the object and returns the value if that doesn't work.
public getValueAttribute ( ) : value
return value

Property Details

$appends protected property

The accessors to append to the model's array form.
protected array $appends
return array

$fillable protected property

The attributes that are mass assignable.
protected array $fillable
return array

$primaryKey protected property

The primary key of the model.
protected string $primaryKey
return string

$table protected property

The database table used by the model.
protected string $table
return string