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 arraygetFlatTree: get all nodes and return asflatten array, the child nodes will be sorted after the parent nodegetAncestors: get allancestornodes of current instancegetAncestorsTree: get allancestornodes of current instance and return asnested arraygetDescendants: get alldescendantnodes of current instancegetDescendantsTree: get alldescendantnodes of current instance and return asnested arrayparent: 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').
ancestorsdescendantsflattenTreeleafNodes
Warning
- If you are using
SoftDeleteand 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. SoftDeleteis required if you usequeue. Because thequeuewill not run indeletinganddeletedevents 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 ...