![]() ![]() To move object to the first position, you only need to: This will set Section ID=2 with sequence attribute like next Section object (based on sequence attribute) and swap their values accordingly. The same you can do it to make your object next in line: Narrowing groups from configuration will be of course used. This will set sequence attribute to one position lower and object one position lower will have sequence attribute changed to one position further. To move object one position higher (swap position with earlier object) you only need to: To get object just add ->orderBy('seq', 'asc') method: Sequence values will be updated accordingly: Sequence attribute will be set during model creation.Īfter this metod field values of $section will be looking as: Note: as a field name do not use name of any exisiting method in that class, including sequence, as this will not work. Use HighSolutions\EloquentSequence\Sequence Run composer update to install the package. Or by adding the following line to the require section of your Laravel webapp's composer.json file: This package can be installed through Composer:Ĭomposer require highsolutions/eloquent-sequence Laravel package for managing sequence of objectsįailed to load latest commit information.Įasy creation and management sequence support for Eloquent models with elastic configuration. Eloquent Evenings Cincinnati FebruEloquent Evenings Cincinnati ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |