public function run() { $class = Log::childClass() . 'Search'; /** @var LogSearch $searchModel */ $searchModel = new $class(); $dataProvider = $searchModel->search([$searchModel->formName() => ['model_name' => get_class($this->model), 'model_id' => $this->model->primaryKey]]); $dataProvider->sort = false; $dataProvider->query->orderBy(['created_at' => SORT_DESC]); return $this->render($this->viewFile, compact('dataProvider')); }
public function up() { $this->createTable(\bariew\logAbstractModule\models\Log::tableName(), ['id' => $this->primaryKey(), 'user_id' => $this->integer(), 'owner_id' => $this->integer(), 'event' => $this->string(), 'model_name' => $this->string(), 'model_id' => $this->string(), 'message' => $this->text(), 'created_at' => $this->integer()]); }
public static function common(Event $event) { return Log::create($event)->save(false); }