PHP code example of plank / laravel-hush

1. Go to this page and download the library: Download plank/laravel-hush library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

plank / laravel-hush example snippets


User::withoutObserver(UserObserver::class, function () {
    User::create(['name' => 'John Doe']);
});

User::withoutObservers([UserObserver::class, ExpirableObserver::class], function () {
    User::create(['name' => 'John Doe']);
});

User::withoutHandler('created', function () {
    User::create(['name' => 'John Doe']);
});

User::withoutHandler('created', function () {
    User::create(['name' => 'John Doe']);
}, [User::class]);