error when i run php artisan migrate command on line 51

Muamar Collins

When I run the php artisan migrate command in terminal I'm left with this.

   ParseError 

  syntax error, unexpected ')'

  at C:\laragon\www\testnum2\vendor\laravel\framework\src\Illuminate\Bus\BusServiceProvider.php:51
     47▕             return new DatabaseBatchRepository(  
     48▕                 $app->make(BatchFactory::class), 
     49▕                 $app->make('db')->connection(config('queue.batching.database')),
     50▕                 config('queue.batching.table', 'job_batches'),
  ➜  51▕             );
     52▕         });
     53▕     }
     54▕
     55▕     /**

  1   C:\laragon\www\testnum2\vendor\composer\ClassLoader.php:322
      Composer\Autoload\includeFile("C:\laragon\www\testnum2\vendor\composer/../laravel/framework/src/Illuminate/Bus/BusServiceProvider.php")

  2   [internal]:0
      Composer\Autoload\ClassLoader::loadClass("Illuminate\Bus\BusServiceProvider")
PS C:\laragon\www\testnum2>

I'm not quite sure what is causing but this is the code for that file thats causing the error.

<?php

namespace Illuminate\Bus;

use Illuminate\Contracts\Bus\Dispatcher as DispatcherContract;
use Illuminate\Contracts\Bus\QueueingDispatcher as QueueingDispatcherContract;
use Illuminate\Contracts\Queue\Factory as QueueFactoryContract;
use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Support\ServiceProvider;

class BusServiceProvider extends ServiceProvider implements DeferrableProvider
{
    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton(Dispatcher::class, function ($app) {
            return new Dispatcher($app, function ($connection = null) use ($app) {
                return $app[QueueFactoryContract::class]->connection($connection);
            });
        });

        $this->registerBatchServices();

        $this->app->alias(
            Dispatcher::class, DispatcherContract::class
        );

        $this->app->alias(
            Dispatcher::class, QueueingDispatcherContract::class
        );
    }

    /**
     * Register the batch handling services.
     *
     * @return void
     */
    protected function registerBatchServices()
    {
        $this->app->singleton(BatchRepository::class, DatabaseBatchRepository::class);

        $this->app->singleton(DatabaseBatchRepository::class, function ($app) {
            return new DatabaseBatchRepository(
                $app->make(BatchFactory::class),
                $app->make('db')->connection(config('queue.batching.database')),
                config('queue.batching.table', 'job_batches'),
            );
        });
    }

    /**
     * Get the services provided by the provider.
     *
     * @return array
     */
    public function provides()
    {
        return [
            Dispatcher::class,
            DispatcherContract::class,
            QueueingDispatcherContract::class,
            BatchRepository::class,
        ];
    }
}

I hope that this is enough to get help. I wanna also mention that I've used php artisan migrate before and recently I had to upgrade some things like composer and phpmyadmin

s.wadhwa

The problem is that the PHP version you're using ( below 7.3 ) does not support trailing comma in function calls.

Please read this: Trailing Commas are allowed in Calls

Solution is to switch to > PHP 7.3

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Laravel | MySQL error when i run php artisan migrate command

Unknown database error when I run php artisan migrate

I been suffering a problem when I run php artisan migrate command

SQLSTATE[42804] Error when trying to heroku run php artisan migrate

php artisan migrate command error : could not find driver

No such file or directory when run php artisan migrate on ubuntu

Problem when I run the 'artisan:migrate' in a 'Many to One' relationship

error on php artisan migrate laravel

Laravel incompatible foreign key error when running php artisan migrate

could not find driver error when using php artisan migrate

I'm having an error while typing php artisan migrate

Laravel project gives Undefined property error when run php artisan serve command

Flyway Error - When I run migrate command. I get "Unable to calculate checksum"

Unable to run php artisan migrate in Laravel

how can i create a php file that runs php artisan migrate command?

Lumen error when using artisan migrate

Got an error in PHP artisan migrate in laravel

PHP Artisan Migrate Error in Lamp Environment

php artisan migrate error in Laravel 5.3

php artisan migrate giving me error in Lumen

PHP Artisan migrate shows a lot of JavaScript error

How to fix " php artisan migrate" error in Laravel

php artisan migrate command error : Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] Connection refused

Why does 'php artisan migrate' command create a migration table along with the table i intended to create?

when using php artisan migrate, change table name in migration, error occur when using tinker to save object

Artisan migrate command no output

How php artisan migrate command uses Connection.php file?

laravel, update table structure but get error table already exist when use php artisan migrate

How to fix error "Foreign key constraint is incorrectly formed" when 'php artisan migrate'?