![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/ledger.corals.io/vendor/yajra/laravel-auditable/src/ |
<?php namespace Yajra\Auditable; use Illuminate\Support\ServiceProvider; use Illuminate\Database\Schema\Blueprint; class AuditableServiceProvider extends ServiceProvider { /** * Boot the package. */ public function boot() { $this->mergeConfigFrom(__DIR__ . '/config/auditable.php', 'auditable'); $this->publishes([ __DIR__ . '/config/auditable.php' => base_path('config/auditable.php'), ], 'auditable'); } /** * Register the service provider. * * @return void */ public function register() { Blueprint::macro('auditable', function () { $this->unsignedBigInteger('created_by')->nullable()->index(); $this->unsignedBigInteger('updated_by')->nullable()->index(); }); Blueprint::macro('dropAuditable', function () { $this->dropColumn(['created_by', 'updated_by']); }); Blueprint::macro('auditableWithDeletes', function () { $this->unsignedBigInteger('created_by')->nullable()->index(); $this->unsignedBigInteger('updated_by')->nullable()->index(); $this->unsignedBigInteger('deleted_by')->nullable()->index(); }); Blueprint::macro('dropAuditableWithDeletes', function () { $this->dropColumn(['created_by', 'updated_by', 'deleted_by']); }); } }