PHP code example of createnl / expires

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

    

createnl / expires example snippets

 php

$table->dateTime('expires_at')->nullable()->default(null);

 php

/**
 * @override
 * Get Carbon object of parsed expiration date.
 *
 * @return Carbon
 */
public function expirationDate() : Carbon
{
    // @todo: Manipulate expiration date
    $interval = new \DateInterval(self::$autoExpireDate);
    return $this->freshTimestamp()->add($interval);
}