Completed
Push — master ( aead87...7136fd )
by Arjay
11:27
created

AuditableServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Yajra\Auditable;
4
5
use Illuminate\Support\ServiceProvider;
6
use Illuminate\Database\Schema\Blueprint;
7
8
class AuditableServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Boot the package.
12
     */
13
    public function boot()
14
    {
15
        $this->mergeConfigFrom(__DIR__ . '/config/auditable.php', 'auditable');
16
        $this->publishes([
17
            __DIR__ . '/config/auditable.php' => base_path('config/auditable.php'),
18
        ], 'auditable');
19
    }
20
21
    /**
22
     * Register the service provider.
23
     *
24
     * @return void
25
     */
26
    public function register()
27
    {
28
        Blueprint::macro('auditable', function () {
29
            $this->unsignedBigInteger('created_by')->nullable()->index();
0 ignored issues
show
Bug introduced by Arjay Q. Angeles
The method unsignedBigInteger() does not seem to exist on object<Yajra\Auditable\AuditableServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
30
            $this->unsignedBigInteger('updated_by')->nullable()->index();
0 ignored issues
show
Bug introduced by Arjay Q. Angeles
The method unsignedBigInteger() does not seem to exist on object<Yajra\Auditable\AuditableServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
31
        });
32
33
        Blueprint::macro('dropAuditable', function () {
34
            $this->dropColumn(['created_by', 'updated_by']);
0 ignored issues
show
Bug introduced by Arjay Angeles
The method dropColumn() does not seem to exist on object<Yajra\Auditable\AuditableServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
35
        });
36
37
        Blueprint::macro('auditableWithDeletes', function () {
38
            $this->unsignedBigInteger('created_by')->nullable()->index();
0 ignored issues
show
Bug introduced by Arjay Q. Angeles
The method unsignedBigInteger() does not seem to exist on object<Yajra\Auditable\AuditableServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
39
            $this->unsignedBigInteger('updated_by')->nullable()->index();
0 ignored issues
show
Bug introduced by Arjay Q. Angeles
The method unsignedBigInteger() does not seem to exist on object<Yajra\Auditable\AuditableServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
40
            $this->unsignedBigInteger('deleted_by')->nullable()->index();
0 ignored issues
show
Bug introduced by Arjay Q. Angeles
The method unsignedBigInteger() does not seem to exist on object<Yajra\Auditable\AuditableServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
41
        });
42
43
        Blueprint::macro('dropAuditableWithDeletes', function () {
44
            $this->dropColumn(['created_by', 'updated_by', 'deleted_by']);
0 ignored issues
show
Bug introduced by Charlie Gilman
The method dropColumn() does not seem to exist on object<Yajra\Auditable\AuditableServiceProvider>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
45
        });
46
    }
47
}
48