antonioribeiro / tracker

Laravel Stats Tracker
MIT License
2.89k stars 595 forks source link

Problem php artisan tracker:tables #342

Open mavinothkumar opened 6 years ago

mavinothkumar commented 6 years ago

When I tried to run php artisan tracker:tables

Am getting [ReflectionException] Method PragmaRX\Tracker\Vendor\Laravel\Artisan\Tables::handle() does not exist

Running in Laravel 5.5 PHP 7.1.10

Please let me know how to fix this.

zymawy commented 6 years ago

Same Issue I Think The Package Not Compatible With Laravel 5.5.20

Update

What I Did Is

I Copy Function From PragmaRX\Tracker\Vendor\Laravel\Artisan\Tables

` public function fire()

{
    $files = $this->laravel->make('files');
    foreach ($files->files($this->getPackageMigrationsPath()) as $file) {
        if (!file_exists($destination = $this->makeMigrationPath($file))) {
            $files->copy($file, $destination);

            $this->info("Migration created: $destination");
        }
    }

    if (isLaravel5()) {
        $this->call('optimize');
    } else {
        $this->call('dump-autoload');
    }
}`

And Changed The Name Of It To handle

`` public function handle()

{
    $files = $this->laravel->make('files');
    foreach ($files->files($this->getPackageMigrationsPath()) as $file) {
        if (!file_exists($destination = $this->makeMigrationPath($file))) {
            $files->copy($file, $destination);

            $this->info("Migration created: $destination");
        }
    }

    if (isLaravel5()) {
        $this->call('optimize');
    } else {
        $this->call('dump-autoload');
    }
}``

And Indeed It Migrated

Try To Copy It Not To Modified

toothbrush7777777 commented 6 years ago

I ran these commands:

php artisan vendor:publish --provider="PragmaRX\Tracker\Vendor\Laravel\ServiceProvider" --tag="config"
php artisan vendor:publish --provider="PragmaRX\Tracker\Vendor\Laravel\ServiceProvider" --tag="migrations"
php artisan migrate