invoiceninja/app/Models/BaseModel.php
David Bomba 77969243fa
Revert "Implement Bulk Actions (#2605)" (#2607)
This reverts commit b635f3b32e927b6ef66667fd2ac73a9d05915777.
2019-01-19 21:34:58 +11:00

27 lines
576 B
PHP

<?php
namespace App\Models;
use Hashids\Hashids;
use Illuminate\Database\Eloquent\Model;
class BaseModel extends Model
{
public function __call($method, $params)
{
$entity = strtolower(class_basename($this));
if ($entity) {
$configPath = "modules.relations.$entity.$method";
if (config()->has($configPath)) {
$function = config()->get($configPath);
return call_user_func_array(array($this, $function[0]), $function[1]);
}
}
return parent::__call($method, $params);
}
}