sukohi/save-without-event
SaveWithoutEvent
A Laravel package to prevent firing a specific event(s) of model when saving.
Installation
Execute composer command.
composer require sukohi/save-without-event:1.*
Preparation
In your model, set SaveWithoutEventTrait.
<?php
namespace App;
use Sukohi\SaveWithoutEvent\SaveWithoutEventTrait;
class User {
use SaveWithoutEventTrait;
That's all.
Now you can use saveWithoutEvent method.
Usage
Use saveWithoutEvent() instead of save() like so.
$user = new \App\User;
// Something..
$user->saveWithoutEvent('saved');
// or with array
$user->saveWithoutEvent(['saving', 'saved']);
saveWithoutEvent()will return boolean result value assave()do.
License
This package is licensed under the MIT License.
Copyright 2017 Sukohi Kuhoh
Related Packages
doctrine/dbal
Powerful PHP database abstraction layer (DBAL) with many features for database s...
644,549,754
9,698
laravel/serializable-closure
Laravel Serializable Closure provides an easy and secure way to serialize closur...
423,477,751
607
nunomaduro/collision
Cli error handling for console/command-line PHP applications.
399,241,428
4,660
Version History
| Version | Released | Laravel | License |
|---|---|---|---|
| 1.0.0 | ~5.0 | MIT |