PHP code example of zing / laravel-eloquent-blameable

1. Go to this page and download the library: Download zing/laravel-eloquent-blameable 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/ */

    

zing / laravel-eloquent-blameable example snippets




use Illuminate\Database\Eloquent\Model;
use Zing\LaravelEloquentBlameable\Blameable;

class Content extends Model
{
    use Blameable;
}



use Illuminate\Database\Eloquent\Model;
use Zing\LaravelEloquentBlameable\Blameable;

class Content extends Model
{
    use Blameable;

    public function getCreatorKeyName(): string
    {
        return 'created_by';
    }

    public function getUpdaterKeyName(): string
    {
        return 'updated_by';
    }
}



use Illuminate\Database\Eloquent\Model;
use Zing\LaravelEloquentBlameable\Blameable;

class Content extends Model
{
    use Blameable;

    public function getCreatorKeyName(): string
    {
        return 'created_by';
    }

    public function getUpdaterKeyName(): ?string
    {
        return null;
    }
}