PHP code example of taam / timeline

1. Go to this page and download the library: Download taam/timeline 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/ */

    

taam / timeline example snippets


$history = Timeline::create([$invoiceModel, $userModel, ..., $anotherModel], 'Initial state');

$history = Timeline::history()->getById($id);

Timeline::event('Event text')
        ->from($eventableModel)
        ->to($history)
        ->withComment('Extended comment to event')
        ->push();

Timeline::events()->getByID($id);

$event->author; // event author

$eventSide = $event->side(); // event side: [initiator_side|second_side]

$history->switchState('New state text'); // Set timeline actual state

$history->getCurrentState(); // Get timeline actual state

Timeline::history($history)->getParticipants(); // get all participants of timeline history
Timeline::history($history)->removeParticipants([$participant1, $participant2]); // delete multiple participants
Timeline::history($history)->getEvents('desc'); // get all events of history with sort
Timeline::history($history)->makeFinished(); // make history as finished
Timeline::history($history)->isFinished(); // check if the story is complete


php artisan vendor:publish

php artisan migrate