Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 11 support #66

Open
tringuyenduc2903 opened this issue Apr 7, 2024 · 1 comment
Open

Laravel 11 support #66

tringuyenduc2903 opened this issue Apr 7, 2024 · 1 comment

Comments

@tringuyenduc2903
Copy link

tringuyenduc2903 commented Apr 7, 2024

[UPDATED]

Version

### PHP VERSION:
8.3.4

### PHP EXTENSIONS:
Core, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, random, Reflection, SPL, session, standard, sodium, mysqlnd, PDO, xml, bcmath, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, iconv, igbinary, imagick, imap, intl, ldap, exif, msgpack, mysqli, pcov, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, readline, redis, shmop, SimpleXML, soap, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, memcached, swoole, Zend OPcache, xdebug

### LARAVEL VERSION:
11.2.0.0

Reproduce the error

  1. Create a new Laravel project
  2. composer require robersonfaria/laravel-database-schedule
./composer.json has been updated
Running composer update robersonfaria/laravel-database-schedule
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
  - Locking robersonfaria/laravel-database-schedule (1.4.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Downloading robersonfaria/laravel-database-schedule (1.4.0)
  - Installing robersonfaria/laravel-database-schedule (1.4.0): Extracting archive
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   Illuminate\Database\QueryException 

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'agilts_backend.schedules' doesn't exist (Connection: mysql, SQL: select * from `schedules` where `status` = 1 and `schedules`.`deleted_at` is null)

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:813
    809▕                     $this->getName(), $query, $this->prepareBindings($bindings), $e
    810▕                 );
    811▕             }
    812▕ 
  ➜ 813▕             throw new QueryException(
    814▕                 $this->getName(), $query, $this->prepareBindings($bindings), $e
    815▕             );
    816▕         }
    817▕     }

  i   A table was not found: You might have forgotten to run your database migrations. 
      https://laravel.com/docs/master/migrations#running-migrations

  1   [internal]:0
      RobersonFaria\DatabaseSchedule\Console\Scheduling\Schedule::__construct()
      +13 vendor frames 

  15  [internal]:0
      RobersonFaria\DatabaseSchedule\Console\Scheduling\Schedule::__construct()

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
  1. php artisan migrate
   Illuminate\Database\QueryException 

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'agilts_backend.schedules' doesn't exist (Connection: mysql, SQL: select * from `schedules` where `status` = 1 and `schedules`.`deleted_at` is null)

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:813
    809▕                     $this->getName(), $query, $this->prepareBindings($bindings), $e
    810▕                 );
    811▕             }
    812▕ 
  ➜ 813▕             throw new QueryException(
    814▕                 $this->getName(), $query, $this->prepareBindings($bindings), $e
    815▕             );
    816▕         }
    817▕     }

  i   A table was not found: You might have forgotten to run your database migrations. 
      https://laravel.com/docs/master/migrations#running-migrations

  1   [internal]:0
      RobersonFaria\DatabaseSchedule\Console\Scheduling\Schedule::__construct()
      +13 vendor frames 

  15  [internal]:0
      RobersonFaria\DatabaseSchedule\Console\Scheduling\Schedule::__construct()

Temporary solution

In vendor/robersonfaria/laravel-database-schedule/src/DatabaseSchedulingServiceProvider.php file

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
    ...
//        Comment this line when initializing the project
//        $this->app->resolving(BaseSchedule::class, function ($schedule) {
//            $schedule = app(Schedule::class, ['schedule' => $schedule]);
//            return $schedule->execute();
//        });
    ...
    }
@tringuyenduc2903
Copy link
Author

I just now have time to install robersonfaria/laravel-database-schedule for a project that needs to upgrade to Laravel 11. However, the integration still has the same problem as the old version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant