Looking to hire Laravel developers? Try LaraJobs

laravel-extend-database maintained by shineyork

Description
Package description here.
Author
Last update
2019/08/23 15:04 (dev-master)
License
Links
Downloads
24

Comments
comments powered by Disqus

Installing

$ composer require shineyork/laravel-extend-database

描述

这是针对于laravel的观察者模型在进行完善的扩展

Model::where('id', '1')->update([
  'name' => 'laravel'
]);

如上的方式修改或者删除而观察者事件失效进一步扩展该功能,使用的方式只需要在模型中引用ShineYork\LaravelExtend\Database\Eloquent\SEvents即可

use Illuminate\Database\Eloquent\Model;
use ShineYork\LaravelExtend\Database\Eloquent\SEvents;

class Category extends Model
{
    use SEvents;
}