Closed Zaheer-Khawaja closed 3 years ago
@Zaheer-Khawaja From the error what I understand that, the required Environment variables are not set properly. Please add the following entry to your .env file and it should work. Thank you for pointing, I am updating the README with this entry.
OTP_TABLE_NAME=otps
First of all; thank you for sharing. I was trying to install otp-validate in Laravel 8. Got this message : I am using MariaDB
composer require ferdous/laravel-otp-validate Using version ^1.2 for ferdous/laravel-otp-validate ./composer.json has been updated Running composer update ferdous/laravel-otp-validate Loading composer repositories with package information Updating dependencies Lock file operations: 1 install, 0 updates, 0 removals
Installing ferdous/laravel-otp-validate (v1.2.0): Extracting archive Generating optimized autoload files
Illuminate\Database\QueryException
SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '' (SQL: create table
` (
idbigint unsigned not null auto_increment primary key,
client_req_idvarchar(255) not null,
numbervarchar(255) null,
emailvarchar(255) null,
typevarchar(255) not null,
otpvarchar(255) not null,
uuidvarchar(255) not null,
retrytinyint not null,
statusenum('new', 'used', 'expired') not null,
created_attimestamp null,
updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')at E:\ZAH\Laravel\moudhah\vendor\laravel\framework\src\Illuminate\Database\Connection.php:678 674▕ // If an exception occurs when attempting to run a query, we'll format the error 675▕ // message to include the bindings with SQL, which will make this exception a 676▕ // lot more helpful to the developer instead of just the database's errors. 677▕ catch (Exception $e) { ➜ 678▕ throw new QueryException( 679▕ $query, $this->prepareBindings($bindings), $e 680▕ ); 681▕ } 682▕
1 E:\ZAH\Laravel\moudhah\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDO\Exception.php:18 Doctrine\DBAL\Driver\PDO\Exception::("SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name ''")
2 E:\ZAH\Laravel\moudhah\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:83 Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException)) Script @php artisan migrate handling the post-update-cmd event returned with error code 1
Installation failed, reverting ./composer.json and ./composer.lock to their original content.