-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Closed
Labels
Description
Laravel Version
10.37.1
PHP Version
8.3.0
Database Driver & Version
SQLite
Description
When using Illuminate/database as a standalone component, following the README instructions and SQLite, the following error is thrown when using hasTable
: Call to undefined function Illuminate\Database\Schema\rescue()
.
This was not an issue with prior Laravel version (namely Laravel 8). There's either a missing dependency, missing installation step, or the hard requirement on rescue
makes it impossible to use it as a standalone component.
Steps To Reproduce
composer require "illuminate/database"
- Create
index.php
<?php
use Illuminate\Database\Capsule\Manager as Capsule;
require_once __DIR__ . '/../vendor/autoload.php';
$capsule = new Capsule();
$capsule->addConnection([
'driver' => 'sqlite',
'database' => 'database.db',
]);
$capsule->setAsGlobal();
echo Capsule::schema()->hasTable('users');
php index.php
Result :
PHP Fatal error: Uncaught Error: Call to undefined function Illuminate\Database\Schema\rescue() in /Users/malou/Desktop/ldb/vendor/illuminate/database/Schema/SQLiteBuilder.php:40
Stack trace:
#0 /Users/malou/Desktop/ldb/vendor/illuminate/database/Schema/Builder.php(162): Illuminate\Database\Schema\SQLiteBuilder->getTables()
#1 /Users/malou/Desktop/ldb/src/index.php(17): Illuminate\Database\Schema\Builder->hasTable('users')
#2 {main}
thrown in /Users/malou/Desktop/ldb/vendor/illuminate/database/Schema/SQLiteBuilder.php on line 40
Fatal error: Uncaught Error: Call to undefined function Illuminate\Database\Schema\rescue() in /Users/malou/Desktop/ldb/vendor/illuminate/database/Schema/SQLiteBuilder.php:40
Stack trace:
#0 /Users/malou/Desktop/ldb/vendor/illuminate/database/Schema/Builder.php(162): Illuminate\Database\Schema\SQLiteBuilder->getTables()
#1 /Users/malou/Desktop/ldb/src/index.php(17): Illuminate\Database\Schema\Builder->hasTable('users')
#2 {main}
thrown in /Users/malou/Desktop/ldb/vendor/illuminate/database/Schema/SQLiteBuilder.php on line 40