PHP code example of mazyvan / userstamps

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

    

mazyvan / userstamps example snippets


$table -> unsignedInteger('created_by') -> nullable() -> default(null) -> after('created_at');
$table -> unsignedInteger('updated_by') -> nullable() -> default(null) -> after('updated_at');

use Mazyvan\Userstamps\Userstamps;

class Example extends Model {

    use Userstamps;
}

$model -> creator; // the user who created the model
$model -> editor; // the user who last updated the model
$model -> destroyer; // the user who deleted the model

const CREATED_BY = 'created_by';
const UPDATED_BY = 'updated_by';
const DELETED_BY = 'deleted_by';