sukohi/save-without-event

A Laravel package to prevent firing a specific event(s) of model when saving.
17
Install
composer require sukohi/save-without-event
Latest Version:1.0.0
Laravel:5
License:MIT
Last Updated:Aug 1, 2017
Links: GitHub  ·  Packagist
Maintainer: Sukohi

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 as save() 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/framework

The Laravel Framework.

598,760,099 34,966
laravel/tinker

Powerful REPL for the Laravel framework.

507,193,856 7,441
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