Download the PHP package medicivn/core without Composer
On this page you can find all versions of the php package medicivn/core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package core
Medici Core
Medici core package
- Repository, Pipeline
- NodesTree
- EloquentNestedSet
- warning
- ApiResponser
- StatusCode, Error Handler
- Helpers
Helpers
Add MediciCoreHelperServiceProvider
to config/app.php
, example:
Functions:
- upload_images
- resize_image
- upload_private_images
- get_url_private
- medici_logger
- generate_random_verification_code
- upload_image_v2
- upload_private_image_v2
Upload Image
- Upload an image
EloquentNestedSet
Automatically update the tree when creating, updating and deleting a node.
How to use:
- First, a root node must be initialized in your model's table
- Add
use EloquentNestedSet;
to your eloquent model, example:
Functions
getTree
: get all nodes and return asnested array
getFlatTree
: get all nodes and return asflatten array
, the child nodes will be sorted after the parent nodegetAncestors
: get allancestor
nodes of current instancegetAncestorsTree
: get allancestor
nodes of current instance and return asnested array
getDescendants
: get alldescendant
nodes of current instancegetDescendantsTree
: get alldescendant
nodes of current instance and return asnested array
parent
: get the parent node to which the current instance belongschildren
: get the child nodes of the current instancegetLeafNodes
: get all leaf nodes - nodes with no children
Other
buildNestedTree
: build a nested tree base onparent_id
Query scopes
The root
node is automatically ignored by a global scope of ignore_root
.
To get the root
node, use withoutGlobalScope('ignore_root')
.
ancestors
descendants
flattenTree
leafNodes
Warning
- If you are using
SoftDelete
and intend to stop using it, you must deal with soft deleted records. The tree will be shuffled, and the calculation of lft and rgt may go wrong. SoftDelete
is required if you usequeue
. Because thequeue
will not run indeleting
anddeleted
events if a record is permanently deleted.
All versions of core with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
illuminate/database Version ^9.17
illuminate/support Version ^9.17
illuminate/http Version ^9.17
illuminate/pipeline Version ^9.17
intervention/image Version ^2.7
illuminate/database Version ^9.17
illuminate/support Version ^9.17
illuminate/http Version ^9.17
illuminate/pipeline Version ^9.17
intervention/image Version ^2.7
The package medicivn/core contains the following files
Loading the files please wait ....