我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

覆盖Eloquent / Model __call

I am trying to override the default __call method for Eloquent/Model, but without luck.

I have tried the following:

function __call($method, $parameters)
{
    die("test");
}

static function __callStatic($method, $parameters)
{
    die("test2");
}

But it simply doesn't die, any ideas?

Try using the __construct() at the top of your controller it works for all function calls

public function __construct() {
    echo '=========>test';
    exit;       
}

近期文章

  • 通过php将数组参数插入mysql
  • Magento主页仅在index.php上存在冲突
  • 比较一个mysql数据库与php的逐个字符
  • WooCommerce单一产品页面 - 删除重复的标签页
  • Symfony2 MongoDB表单验证程序不加载DocumentManager
  • PHPMailer不能与gmail一起使用
  • PHP - MySQLi UPDATE +1确实增加了2
  • Apache mod_asis的AddHandler无法正常工作
  • 卷曲返回NULL为LinkedIn共享计数请求
  • 使用TYPO3 6.2中的itemsProcFunc扩展包含字段的页表
  • yii从$ _GET加载数据库中的数据
  • 如何通过函数将MySQL数据从PHP传递给Javascript
  • Cakephp生成带有大写控制器名称的小写URL
  • Bootstrap glyphicons在codeigniter中表现得很奇怪
  • jnd文件上传(blueimp)与zend框架2(zf2)
  • 将css应用于从数据库中提取的数据
  • json中返回的php中的javascript window.location
  • on_presence_stanza回调用于JMPL中的XMPP定向存在
  • 在zend缓存中调用非对象的成员函数save()
  • Mongodb聚合排序关联数组

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华