1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/app/Models/BaseModel.php

27 lines
542 B
PHP
Raw Normal View History

<?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 $function($this);
}
}
return parent::__call($method, $params);
}
}