PHP code example of jeffersongoncalves / laravel-created-by

1. Go to this page and download the library: Download jeffersongoncalves/laravel-created-by 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/ */

    

jeffersongoncalves / laravel-created-by example snippets


Schema::create('posts', function (Blueprint $table) {
    $table->createdBy();
    $table->updatedBy();
    $table->deletedBy();
    $table->restoredBy();
    $table->restoredAt();
    $table->softDeletes();
});



namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use JeffersonGoncalves\CreatedBy\WithCreatedBy;
use JeffersonGoncalves\CreatedBy\WithUpdatedBy;
use JeffersonGoncalves\CreatedBy\WithDeletedBy;
use JeffersonGoncalves\CreatedBy\WithRestoredBy;
use JeffersonGoncalves\CreatedBy\WithRestoredAt;

class Post extends Model
{
    use SoftDeletes;
    use WithCreatedBy;
    use WithUpdatedBy;
    use WithDeletedBy;
    use WithRestoredBy;
    use WithRestoredAt;
}