<?php
 namespace App\Modules\Base; use Illuminate\Support\Facades\Request; use TechOnline\Laravel\Dao\ModelUtil; trait SettingOwnerTrait { public static function owner() { static $memberUserId = null; if (null === $memberUserId) { self::setupSetting(); $memberUserId = 0; $alias = Request::route('alias'); if (!empty($alias)) { $setting = ModelUtil::get('module_' . MODULE_SETTING_NAME_UNDERSCORE . '_setting', ['alias' => $alias]); if (!empty($setting)) { $memberUserId = $setting['memberUserId']; } } } return $memberUserId; } }