AbstractModel.php
591 Bytes
<?php
/**
* @Author: irul
* @Date: 2019-09-27 20:55:56
* @Last Modified by: irul
* @Last Modified time: 2019-10-01 23:43:20
*/
namespace Integrasi\Reklame\Base\Models;
use \Illuminate\Database\Eloquent\Model;
class AbstractModel extends Model
{
const CREATED_AT = 'create_date';
const UPDATED_AT = 'write_date';
/**
* get current namespace
* ref: https://stackoverflow.com/a/6776525
*/
protected function getParentNamespace()
{
$currentClass = get_class($this);
$reflection = new \ReflectionClass($currentClass);
return $reflection->getNamespaceName();
}
}