overrideLaravelLocalization()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Foundation\Providers;
6
7
use Illuminate\Routing\Router;
8
use Illuminate\Support\Collection;
9
use Illuminate\Support\Facades\Schema;
10
use Illuminate\Support\ServiceProvider;
11
use Rinvex\Support\Traits\ConsoleTools;
12
use Illuminate\Database\Schema\Blueprint;
13
use Cortex\Foundation\Models\ImportRecord;
14
use Cortex\Foundation\Models\AbstractModel;
15
use Illuminate\View\Compilers\BladeCompiler;
16
use Cortex\Foundation\Http\Middleware\Clockwork;
17
use Cortex\Foundation\Generators\LangJsGenerator;
18
use Cortex\Foundation\Console\Commands\SeedCommand;
19
use Illuminate\Database\Eloquent\Relations\Relation;
20
use Cortex\Foundation\Console\Commands\InstallCommand;
21
use Cortex\Foundation\Console\Commands\MigrateCommand;
22
use Cortex\Foundation\Console\Commands\PublishCommand;
23
use Cortex\Foundation\Console\Commands\CoreSeedCommand;
24
use Cortex\Foundation\Console\Commands\RollbackCommand;
25
use Illuminate\Support\Facades\Session as SessionFacade;
26
use Cortex\Foundation\Verifiers\EloquentPresenceVerifier;
27
use Cortex\Foundation\Console\Commands\CoreInstallCommand;
28
use Cortex\Foundation\Console\Commands\CoreMigrateCommand;
29
use Cortex\Foundation\Console\Commands\CorePublishCommand;
30
use Cortex\Foundation\Console\Commands\CoreRollbackCommand;
31
use Cortex\Foundation\Http\Middleware\NotificationMiddleware;
32
use Cortex\Foundation\Overrides\Illuminate\Routing\Redirector;
33
use Cortex\Foundation\Overrides\Illuminate\Routing\UrlGenerator;
34
use Cortex\Foundation\Overrides\Mcamara\LaravelLocalization\LaravelLocalization;
35
use Cortex\Foundation\Overrides\Mariuzzo\LaravelJsLocalization\Commands\LangJsCommand;
36
37
class FoundationServiceProvider extends ServiceProvider
38
{
39
    use ConsoleTools;
40
41
    /**
42
     * The commands to be registered.
43
     *
44
     * @var array
45
     */
46
    protected $commands = [
47
        SeedCommand::class => 'command.cortex.foundation.seed',
48
        InstallCommand::class => 'command.cortex.foundation.install',
49
        MigrateCommand::class => 'command.cortex.foundation.migrate',
50
        PublishCommand::class => 'command.cortex.foundation.publish',
51
        RollbackCommand::class => 'command.cortex.foundation.rollback',
52
        CoreSeedCommand::class => 'command.cortex.foundation.coreseed',
53
        CoreInstallCommand::class => 'command.cortex.foundation.coreinstall',
54
        CoreMigrateCommand::class => 'command.cortex.foundation.coremigrate',
55
        CorePublishCommand::class => 'command.cortex.foundation.corempublish',
56
        CoreRollbackCommand::class => 'command.cortex.foundation.corerollback',
57
    ];
58
59
    /**
60
     * Register any application services.
61
     *
62
     * This service provider is a great spot to register your various container
63
     * bindings with the application. As you can see, we are registering our
64
     * "Registrar" implementation here. You can add your own bindings too!
65
     *
66
     * @return void
67
     */
68
    public function register(): void
69
    {
70
        $this->overrideNotificationMiddleware();
71
        $this->overrideLaravelLocalization();
72
        $this->overrideUrlGenerator();
73
        $this->bindPresenceVerifier();
74
        $this->bindBlueprintMacro();
75
        $this->overrideRedirector();
76
        $this->bindBladeCompiler();
77
        $this->overrideLangJS();
78
79
        // Bind eloquent models to IoC container
80
        $this->app->singleton('cortex.foundation.import_record', $importerModel = $this->app['config']['cortex.foundation.models.import_record']);
81
        $importerModel === ImportRecord::class || $this->app->alias('cortex.foundation.import_record', ImportRecord::class);
82
83
        // Merge config
84
        $this->mergeConfigFrom(realpath(__DIR__.'/../../config/config.php'), 'cortex.foundation');
85
86
        // Override datatables html builder
87
        $this->app->bind(\Yajra\DataTables\Html\Builder::class, \Cortex\Foundation\Overrides\Yajra\DataTables\Html\Builder::class);
88
89
        // Register console commands
90
        ! $this->app->runningInConsole() || $this->registerCommands();
91
    }
92
93
    /**
94
     * Bootstrap any application services.
95
     *
96
     * @return void
97
     */
98
    public function boot(Router $router): void
99
    {
100
        // Fix the specified key was too long error
101
        Schema::defaultStringLength(191);
102
103
        // Override presence verifier
104
        $this->app['validator']->setPresenceVerifier($this->app['cortex.foundation.presence.verifier']);
105
106
        // Early set application locale globaly
107
        $router->pattern('locale', '[a-z]{2}');
108
        $this->app['laravellocalization']->setLocale();
109
110
        $router->model('media', config('medialibrary.media_model'));
111
112
        // Map relations
113
        Relation::morphMap([
114
            'media' => config('medialibrary.media_model'),
115
        ]);
116
117
        // Load resources
118
        $this->loadRoutesFrom(__DIR__.'/../../routes/web/adminarea.php');
119
        $this->loadRoutesFrom(__DIR__.'/../../routes/web/frontarea.php');
120
        $this->loadRoutesFrom(__DIR__.'/../../routes/web/tenantarea.php');
121
        $this->loadRoutesFrom(__DIR__.'/../../routes/web/managerarea.php');
122
        $this->loadViewsFrom(__DIR__.'/../../resources/views', 'cortex/foundation');
123
        $this->loadTranslationsFrom(__DIR__.'/../../resources/lang', 'cortex/foundation');
124
        $this->app->runningInConsole() || $this->app->afterResolving('blade.compiler', function () {
125
            $accessarea = $this->app['request']->route('accessarea');
126
            ! file_exists($menus = __DIR__."/../../routes/menus/{$accessarea}.php") || require $menus;
127
            ! file_exists($breadcrumbs = __DIR__."/../../routes/breadcrumbs/{$accessarea}.php") || require $breadcrumbs;
128
        });
129
130
        // Publish Resources
131
        ! $this->app->runningInConsole() || $this->publishesLang('cortex/foundation', true);
132
        ! $this->app->runningInConsole() || $this->publishesViews('cortex/foundation', true);
133
        ! $this->app->runningInConsole() || $this->publishesConfig('cortex/foundation', true);
134
        ! $this->app->runningInConsole() || $this->publishesMigrations('cortex/foundation', true);
135
136
        SessionFacade::extend('database', function ($app) {
137
            $table = $app['config']['session.table'];
138
139
            $lifetime = $app['config']['session.lifetime'];
140
            $connection = $app['config']['session.connection'];
141
142
            return new \Cortex\Foundation\Overrides\Illuminate\Session\DatabaseSessionHandler(
143
                $app['db']->connection($connection), $table, $lifetime, $app
144
            );
145
        });
146
147
        $this->app->booted(function () {
148
            if ($this->app->routesAreCached()) {
149
                require $this->app->getCachedRoutesPath();
150
            } else {
151
                $this->app['router']->getRoutes()->refreshNameLookups();
152
                $this->app['router']->getRoutes()->refreshActionLookups();
153
            }
154
        });
155
156
        // Append middleware to the 'web' middlware group
157
        app()->environment('production') || $router->pushMiddlewareToGroup('web', Clockwork::class);
158
159
        Collection::macro('similar', function (Collection $newCollection) {
160
            return $newCollection->diff($this)->isEmpty() && $this->diff($newCollection)->isEmpty();
0 ignored issues
show
Bug introduced by
The method diff() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
161
        });
162
    }
163
164
    /**
165
     * Override notification middleware.
166
     *
167
     * @return void
168
     */
169
    protected function overrideNotificationMiddleware(): void
170
    {
171
        $this->app->singleton('Cortex\Foundation\Http\Middleware\NotificationMiddleware', function ($app) {
172
            return new NotificationMiddleware(
173
                $app['session.store'],
174
                $app['notification'],
175
                $app['config']->get('notification.session_key')
176
            );
177
        });
178
    }
179
180
    /**
181
     * Bind blade compiler.
182
     *
183
     * @return void
184
     */
185
    protected function bindBladeCompiler(): void
186
    {
187
        $this->app->afterResolving('blade.compiler', function (BladeCompiler $bladeCompiler) {
188
189
            // @alerts('container')
190
            $bladeCompiler->directive('alerts', function ($container = null) {
191
                if (strcasecmp('()', $container) === 0) {
192
                    $container = null;
193
                }
194
195
                return "<?php echo app('notification')->container({$container})->show(); ?>";
196
            });
197
        });
198
    }
199
200
    /**
201
     * Override the Redirector instance.
202
     *
203
     * @return void
204
     */
205
    protected function overrideRedirector(): void
206
    {
207
        $this->app->singleton('redirect', function ($app) {
208
            $redirector = new Redirector($app['url']);
209
210
            // If the session is set on the application instance, we'll inject it into
211
            // the redirector instance. This allows the redirect responses to allow
212
            // for the quite convenient "with" methods that flash to the session.
213
            if (isset($app['session.store'])) {
214
                $redirector->setSession($app['session.store']);
215
            }
216
217
            return $redirector;
218
        });
219
    }
220
221
    /**
222
     * Override the UrlGenerator instance.
223
     *
224
     * @return void
225
     */
226
    protected function overrideUrlGenerator(): void
227
    {
228
        $this->app->singleton('url', function ($app) {
229
            $routes = $app['router']->getRoutes();
230
231
            // The URL generator needs the route collection that exists on the router.
232
            // Keep in mind this is an object, so we're passing by references here
233
            // and all the registered routes will be available to the generator.
234
            $app->instance('routes', $routes);
235
236
            $url = new UrlGenerator(
237
                $routes, $app->rebinding(
238
                    'request', $this->requestRebinder()
239
                )
240
            );
241
242
            $url->setSessionResolver(function () {
243
                return $this->app['session'];
244
            });
245
246
            // If the route collection is "rebound", for example, when the routes stay
247
            // cached for the application, we will need to rebind the routes on the
248
            // URL generator instance so it has the latest version of the routes.
249
            $app->rebinding('routes', function ($app, $routes) {
250
                $app['url']->setRoutes($routes);
251
            });
252
253
            return $url;
254
        });
255
    }
256
257
    /**
258
     * Get the URL generator request rebinder.
259
     *
260
     * @return \Closure
261
     */
262
    protected function requestRebinder()
263
    {
264
        return function ($app, $request) {
265
            $app['url']->setRequest($request);
266
        };
267
    }
268
269
    /**
270
     * Override the LaravelLocalization instance.
271
     *
272
     * @return void
273
     */
274
    protected function overrideLaravelLocalization(): void
275
    {
276
        $this->app->singleton('laravellocalization', function () {
277
            return new LaravelLocalization();
278
        });
279
    }
280
281
    /**
282
     * Register console commands.
283
     *
284
     * @return void
285
     */
286
    protected function overrideLangJS(): void
287
    {
288
        // Bind the Laravel JS Localization command into the app IOC.
289
        $this->app->singleton('localization.js', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
290
            $app = $this->app;
291
            $laravelMajorVersion = (int) $app::VERSION;
292
293
            $files = $app['files'];
294
295
            if ($laravelMajorVersion === 4) {
296
                $langs = $app['path.base'].'/app/lang';
297
            } elseif ($laravelMajorVersion === 5) {
298
                $langs = $app['path.base'].'/resources/lang';
299
            }
300
            $messages = $app['config']->get('localization-js.messages');
301
            $generator = new LangJsGenerator($files, $langs, $messages);
0 ignored issues
show
Bug introduced by
The variable $langs does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
302
303
            return new LangJsCommand($generator);
304
        });
305
306
        // Bind the Laravel JS Localization command into Laravel Artisan.
307
        $this->commands('localization.js');
308
    }
309
310
    /**
311
     * Bind presence verifier.
312
     *
313
     * @return void
314
     */
315
    protected function bindPresenceVerifier(): void
316
    {
317
        $this->app->bind('cortex.foundation.presence.verifier', function ($app) {
318
            return new EloquentPresenceVerifier($app['db'], new $app[AbstractModel::class]());
319
        });
320
    }
321
322
    /**
323
     * Bind blueprint macro.
324
     *
325
     * @return void
326
     */
327
    protected function bindBlueprintMacro(): void
328
    {
329
        Blueprint::macro('auditable', function () {
330
            $this->integer('created_by_id')->unsigned()->after('created_at')->nullable();
0 ignored issues
show
Bug introduced by
The method integer() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
331
            $this->string('created_by_type')->after('created_at')->nullable();
0 ignored issues
show
Bug introduced by
The method string() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
332
            $this->integer('updated_by_id')->unsigned()->after('updated_at')->nullable();
0 ignored issues
show
Bug introduced by
The method integer() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
333
            $this->string('updated_by_type')->after('updated_at')->nullable();
0 ignored issues
show
Bug introduced by
The method string() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
334
        });
335
336
        Blueprint::macro('dropAuditable', function () {
337
            $this->dropForeign($this->createIndexName('foreign', ['updated_by_type']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
338
            $this->dropForeign($this->createIndexName('foreign', ['updated_by_id']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
339
            $this->dropForeign($this->createIndexName('foreign', ['created_by_type']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
340
            $this->dropForeign($this->createIndexName('foreign', ['created_by_id']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
341
            $this->dropColumn(['updated_by_type', 'updated_by_id', 'created_by_type', 'created_by_id']);
0 ignored issues
show
Bug introduced by
The method dropColumn() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
342
        });
343
344
        Blueprint::macro('auditableAndTimestamps', function ($precision = 0) {
345
            $this->timestamp('created_at', $precision)->nullable();
0 ignored issues
show
Bug introduced by
The method timestamp() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
346
            $this->integer('created_by_id')->unsigned()->nullable();
0 ignored issues
show
Bug introduced by
The method integer() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
347
            $this->string('created_by_type')->nullable();
0 ignored issues
show
Bug introduced by
The method string() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
348
            $this->timestamp('updated_at', $precision)->nullable();
0 ignored issues
show
Bug introduced by
The method timestamp() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
349
            $this->integer('updated_by_id')->unsigned()->nullable();
0 ignored issues
show
Bug introduced by
The method integer() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
350
            $this->string('updated_by_type')->nullable();
0 ignored issues
show
Bug introduced by
The method string() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
351
        });
352
353
        Blueprint::macro('dropauditableAndTimestamps', function () {
354
            $this->dropForeign($this->createIndexName('foreign', ['updated_by_type']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
355
            $this->dropForeign($this->createIndexName('foreign', ['updated_by_id']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
356
            $this->dropForeign($this->createIndexName('foreign', ['updated_at']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
357
            $this->dropForeign($this->createIndexName('foreign', ['created_by_type']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
358
            $this->dropForeign($this->createIndexName('foreign', ['created_by_id']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
359
            $this->dropForeign($this->createIndexName('foreign', ['created_at']));
0 ignored issues
show
Bug introduced by
The method createIndexName() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
Bug introduced by
The method dropForeign() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
360
            $this->dropColumn(['updated_by_type', 'updated_by_id', 'updated_at', 'created_by_type', 'created_by_id', 'created_at']);
0 ignored issues
show
Bug introduced by
The method dropColumn() does not seem to exist on object<Cortex\Foundation...ndationServiceProvider>.

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...
361
        });
362
    }
363
}
364