PHP code example of riorizkyrainey / lara-ced

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

    

riorizkyrainey / lara-ced example snippets


Schema::create('article', function (Blueprint $table) {
    $table->increments('id');
    $table->string('title', 100);
    $table->ced(); //add 'created_by', 'updated_by' and 'deleted_by'
    $table->timestamps();
});

Schema::create('article', function (Blueprint $table) {
    $table->increments('id');
    $table->string('title', 100);
    $table->creator(); // Add created_by
    $table->editor(); // Add updated_by
    $table->destroyer(); // Add deleted_by
    $table->timestamps();
});

Schema::create('article', function (Blueprint $table) {
    $table->increments('id');
    $table->string('title', 100);
    $table->creator('seng_gawe'); // Add seng_gawe
    $table->editor('seng_edit'); // Add seng_edit
    $table->destroyer('seng_ndelet'); // Add seng_ndelet
    $table->timestamps();
});

$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';

Schema::table('articles', function (Blueprint $table) {
    $table->dropCed();
});