PHPackages                             imagina/ischedulable-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. imagina/ischedulable-module

ActiveAsgard-module

imagina/ischedulable-module
===========================

10.0.0(1y ago)01.0k51MITPHPPHP ^8.1

Since Oct 11Pushed 1y ago3 watchersCompare

[ Source](https://github.com/imagina/imaginacms-ischedulable)[ Packagist](https://packagist.org/packages/imagina/ischedulable-module)[ RSS](/packages/imagina-ischedulable-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (5)Used By (1)

imaginacms-ischedulable
=======================

[](#imaginacms-ischedulable)

Polymorphic module to relate a schedule entity

> To use, Run migrations and seeds.

Install
-------

[](#install)

```
composer require imagina/ischedulable-module=v8.x-dev
```

Enable the module
-----------------

[](#enable-the-module)

```
php artisan module:enable Ischedulable
```

Traits
------

[](#traits)

- schedulable
    -----------

    [](#schedulable)

    Synchronize schedules related to your model. Listen the Event `createdWithBindings` and `updatedWithBindings` to do it.
    - #### Relations

        [](#relations)

        - **schedule** `morphOne` Return all related schedule of your model.
        - **schedule.workTimes** `hasMany` Return all related schedule with their workTimes.
        - **schedule.workTimes.day** `belongsTo` Return all related schedule with their workTimes and their day.
        -
    - #### Use

        [](#use)

        Use the `Schedulable` Trait in your entity.

        ```
        use Modules\Ischedulable\Support\Traits\Schedulable;

        class YourEntityClass extends CrudModel
        {
          use Translatable, Schedulable;

          // Your entity code...
        }
        ```

        When you are creating or updating your entity, add the schedule data to sync it.

        > Sync: Only when the entity data has the `schedule` attribute the trait will make the sync.

        > Remove: To remove the schedule of the entity, sent in the entity data the attribute `schedule` as `false`.

        ```
          //Entity Data
          {
          // Your entity attributes/data..

          // Schedule data to sync with the entity
          "schedule": {
            "zone": "main",
            "status": 1,
            "from_date" : "2021-03-08 08:00",
            "to_date" : "2021-03-08 08:00",
            "work_times": [
              {
                "day_id": 2,
                "start_hour": "2021-03-08 08:00",
                "end_hour": "2021-03-08 10:00",
                "shift_time" : "60",
              },
              {
                "day_id": 1,
                "start_hour": "2021-03-08 07:00",
                "end_hour": "2021-03-08 12:30",
                "shift_time" : "60",
              }
           ]
          }
        }
        ```

Entities
--------

[](#entities)

- Schedule
    --------

    [](#schedule)

    Save Polymorphic Schedules

    - #### Relations

        [](#relations-1)

        - **worktimes** `hasMany` Return all related workTime of schedule.
    - #### Methods

        [](#methods)

        - **getShifts(\['dateRange','busyShifts'\])** Return all shifts according to worktimes of the schedule by intervals of minutes. > To get shifts with the day model add in request the relation `workTimes.day`

            - **Parameters**
                - ***dateRange*** `Array` one array with the date range to generate the shifts, if not exist this parameter will loaded the current date until 6 days in future. ```
                    //Obtain the shifts to 2021-09-01 until 2021-09-03 according to workTimes by day of the shedule model
                    $scheduleModel->getShifts(['dateRange' => ['2021-09-01', '2021-09-03']])
                    ```
                - ***busyShifts*** `Array of Arrays` Array with the busy shift reference to validate if shift generate by the method is busy or not. ```
                    $scheduleModel->getShifts([
                      'busyShifts' => [
                        ['startTime' => '06:00:00', 'endTime' => '08:22:00', 'calendarDate' => '2021-09-06'],
                        ['startTime' => '06:00:00', 'endTime' => '07:22:00', 'calendarDate' => '2021-09-02'],
                        ['startTime' => '08:00:00', 'endTime' => '09:00:00', 'calendarDate' => '2021-09-03'],
                      ]
                    ]);
                    ```
            - Response
                Yo get shifts orderer by calendarDate, dayId and startTime on asc way ```
                //You get a array of arrays with shifts on this format
                [▼
                  "busyBy" => [/*busy model set on parameter busyShift*/]
                  "calendarDate" => "2021-09-06"
                  "day" => //Modules\Ischedulable\Entities\Day Model
                  "dayId" => 1 //Iso Day
                  "endTime" => "09:00:00"
                  "isBusy" => 1
                  "scheduleId" => 7
                  "startTime" => "08:00:00"
                ]
                ```
- WorkTime
    --------

    [](#worktime)

    Save one or many work time to schedule

    - #### Relations

        [](#relations-2)

        - **day** `belongsTo` Return the Day model.
        - **schedule** `belongsTo` Return the Schedule model
    - #### Methods

        [](#methods-1)

        - **getShifts()** Generate and return the shifts of the current worktime. ```
            $workTimeModel->getShifts()
            ```
- Day
    ---

    [](#day)

    Has the translatable week days with the iso number

    DayISOMonday1Tuesday2Wednesday3Thursday4Friday5Saturday6Sunday7

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor3

3 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~113 days

Total

3

Last Release

480d ago

PHP version history (2 changes)10.0.0PHP ^8.1

v8.x-devPHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2bc4bd5d733cfbe7e145670fbb1539bdb8d33f43c2cca4f26a119d37dfbad62f?d=identicon)[imagina](/maintainers/imagina)

---

Top Contributors

[![CristianMarin19](https://avatars.githubusercontent.com/u/54483189?v=4)](https://github.com/CristianMarin19 "CristianMarin19 (11 commits)")[![msolanogithub](https://avatars.githubusercontent.com/u/38920570?v=4)](https://github.com/msolanogithub "msolanogithub (9 commits)")[![JCEC007](https://avatars.githubusercontent.com/u/7571125?v=4)](https://github.com/JCEC007 "JCEC007 (8 commits)")[![imagina](https://avatars.githubusercontent.com/u/758247?v=4)](https://github.com/imagina "imagina (7 commits)")[![willvrd](https://avatars.githubusercontent.com/u/8865099?v=4)](https://github.com/willvrd "willvrd (4 commits)")[![msolanoimagina](https://avatars.githubusercontent.com/u/121646384?v=4)](https://github.com/msolanoimagina "msolanoimagina (1 commits)")[![odchunzag](https://avatars.githubusercontent.com/u/43626463?v=4)](https://github.com/odchunzag "odchunzag (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/imagina-ischedulable-module/health.svg)

```
[![Health](https://phpackages.com/badges/imagina-ischedulable-module/health.svg)](https://phpackages.com/packages/imagina-ischedulable-module)
```

###  Alternatives

[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k15.7k5](/packages/elgg-elgg)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[johnbillion/user-switching

Instant switching between user accounts in WordPress and WooCommerce.

19768.3k2](/packages/johnbillion-user-switching)[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[rainlab/user-plugin

User plugin for October CMS

11954.3k13](/packages/rainlab-user-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
