PHP code example of alish / activeable-model

1. Go to this page and download the library: Download alish/activeable-model library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alish / activeable-model example snippets


class Model {
    use IsActiveable;

    protected bool $defaultStatus = false;
}

    $histories = $model->activeStates()->get();

    // get the exact time of state change
    /** @var \Carbon\Carbon $changeStateTime */
    $changeStateTime = $histories->first()->created_at;

    // you can also get the status of state change
    /** @var bool $status */
    $status = $histories->first()->is_active;
bash
php artisan vendor:publish --provider="Alish\ActiveableModel\ActiveableModelServiceProvider" --tag=migrations