Product extends Model Uses HasFactory, SoftDeletes
Table of Contents
- $casts : array<string|int, mixed>
- The attributes that should be cast.
- $dates : array<string|int, mixed>
- Column for soft deletes
- $fillable : array<string|int, mixed>
- The attributes that are mass assignable.
- $hidden : array<string|int, mixed>
- The attributes excluded from the model's JSON form.
- $table : string
- The table associated with the model.
- boot() : mixed
- getStoreAttribute() : object
- Gets the store associated to the product
- store() : BelongsTo
- Gets the store which owns the product.
Properties
$casts
The attributes that should be cast.
protected
array<string|int, mixed>
$casts
= ['status' => 'boolean', 'quantity' => 'integer', 'buying_price' => 'float', 'selling_price' => 'float']
$dates
Column for soft deletes
protected
array<string|int, mixed>
$dates
= ["deleted_at"]
$fillable
The attributes that are mass assignable.
protected
array<string|int, mixed>
$fillable
= ['store_id', 'ref', 'name', 'quantity', 'buying_price', 'selling_price', 'note', 'status']
$hidden
The attributes excluded from the model's JSON form.
protected
array<string|int, mixed>
$hidden
= ['updated_at', 'created_at', 'deleted_at']
$table
The table associated with the model.
protected
string
$table
= "products"
Methods
boot()
public
static boot() : mixed
Return values
mixed —getStoreAttribute()
Gets the store associated to the product
public
getStoreAttribute() : object
Return values
object —store()
Gets the store which owns the product.
public
store() : BelongsTo