PHP Class Encore\Admin\Auth\Database\Menu

Inheritance: extends Illuminate\Database\Eloquent\Model
Mostrar archivo Open project: z-song/laravel-admin Class Usage Examples

Protected Properties

Property Type Description
$branchOrder array
$fillable array The attributes that are mass assignable.

Public Methods

Method Description
__construct ( array $attributes = [] ) Create a new Eloquent model instance.
buildSelectOptions ( array $elements = [], integer $parentId, string $prefix = '' ) : array Build options of select field in form.
delete ( ) : boolean | null Delete current item and its children.
roles ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany A Menu belongs to many roles.
saveTree ( array $tree = [], integer $parentId ) Save a tree from a tree like array.
toTree ( array $elements = [], integer $parentId ) : array Format data to tree like array.

Protected Methods

Method Description
setBranchOrder ( array $order ) : void Set the order of branches in the tree.

Method Details

__construct() public method

Create a new Eloquent model instance.
public __construct ( array $attributes = [] )
$attributes array

buildSelectOptions() public static method

Build options of select field in form.
public static buildSelectOptions ( array $elements = [], integer $parentId, string $prefix = '' ) : array
$elements array
$parentId integer
$prefix string
return array

delete() public method

Delete current item and its children.
public delete ( ) : boolean | null
return boolean | null

roles() public method

A Menu belongs to many roles.
public roles ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany
return Illuminate\Database\Eloquent\Relations\BelongsToMany

saveTree() public static method

Save a tree from a tree like array.
public static saveTree ( array $tree = [], integer $parentId )
$tree array
$parentId integer

setBranchOrder() protected static method

Set the order of branches in the tree.
protected static setBranchOrder ( array $order ) : void
$order array
return void

toTree() public static method

Format data to tree like array.
public static toTree ( array $elements = [], integer $parentId ) : array
$elements array
$parentId integer
return array

Property Details

$branchOrder protected_oe static_oe property

protected static array $branchOrder
return array

$fillable protected_oe property

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