runner/fastd-eloquent

FastD 框架的 eloquent

v1.0.12 2019-11-25 16:09 UTC

This package is auto-updated.

Last update: 2024-08-26 12:59:12 UTC


README

在 FastD 中的 illuminate/database

功能

  • 支持 Eloquent ORM
  • 支持分页
  • 中间件捕获 NotFoundException

安装

composer require runner/fastd-eloquent

使用

配置服务提供者

\Runner\FastdEloquent\EloquentServiceProvider::class

事件和观察者

如果需要使用模型事件或观察者,需要注册服务提供者

\Runner\FastdEloquent\EventServiceProvider::class

并增加配置 event.php

<?php
return [
    'listen' => [
        CustomEvent::class => [
            CustomListener::class,    
        ],
    ],
    'observer' => [
        CustomModel::class => CustomObserver::class,    
    ],
];

文档