๐งช Testing Ticket Scan API ========================== Setup: Creating test scanner device... โ Scanner created: โ JWT token generated Setup: Finding test event and ticket... โ Using event: (ID: 1) โ Using ticket:
Illuminate\Database\QueryException {#2019 +errorInfo: array:3 [ 0 => "42S22" 1 => 1054 2 => "Unknown column 'verification_code' in 'WHERE'" ] #sql: "delete from `ticket_validations` where `verification_code` is null" #bindings: [] }
// If an exception occurs when attempting to run a query, we'll format the error // message to include the bindings with SQL, which will make this exception a // lot more helpful to the developer instead of just the database's errors. catch (Exception $e) { throw new QueryException( $query, $this->prepareBindings($bindings), $e ); } } // Here we will run this query. If an exception occurs we'll determine if it was // caused by a connection that has been lost. If that is the cause, we'll try // to re-establish connection and re-run the query with a fresh connection. try { $result = $this->runQueryCallback($query, $bindings, $callback); } catch (QueryException $e) { $result = $this->handleQueryException( $e, $query, $bindings, $callback ); } * @param array $bindings * @return int */ public function affectingStatement($query, $bindings = []) { return $this->run($query, $bindings, function ($query, $bindings) { if ($this->pretending()) { return 0; } // For update or delete statements, we want to get the number of rows affected * @param array $bindings * @return int */ public function delete($query, $bindings = []) { return $this->affectingStatement($query, $bindings); } /** * Execute an SQL statement and return the boolean result. * $this->where($this->from.'.id', '=', $id); } $this->applyBeforeQueryCallbacks(); return $this->connection->delete( $this->grammar->compileDelete($this), $this->cleanBindings( $this->grammar->prepareBindingsForDelete($this->bindings) ) ); } { if (isset($this->onDelete)) { return call_user_func($this->onDelete, $this); } return $this->toBase()->delete(); } /** * Run the default delete function on the builder. * die("โ No tickets found for this event. Please create tickets first.\n");}echo "โ
Using ticket: {$ticket->verification_code}\n\n";// Clear previous test scansTicketValidation::where('verification_code', $ticket->verification_code)->delete();echo "โ
Cleared previous test scans\n\n";/** * Helper function to make API requests */ } // For update or delete statements, we want to get the number of rows affected // by the statement and return that back to the developer. We'll first need // to execute the statement and then we'll use PDO to fetch the affected. $statement = $this->getPdo()->prepare($query); $this->bindValues($statement, $this->prepareBindings($bindings)); $statement->execute(); } // For update or delete statements, we want to get the number of rows affected // by the statement and return that back to the developer. We'll first need // to execute the statement and then we'll use PDO to fetch the affected. $statement = $this->getPdo()->prepare($query); $this->bindValues($statement, $this->prepareBindings($bindings)); $statement->execute(); { // To execute the statement, we'll simply call the callback, which will actually // run the SQL against the PDO connection. Then we can calculate the time it // took to execute and log the query SQL, bindings and time in our memory. try { return $callback($query, $bindings); } // If an exception occurs when attempting to run a query, we'll format the error // message to include the bindings with SQL, which will make this exception a // lot more helpful to the developer instead of just the database's errors. // Here we will run this query. If an exception occurs we'll determine if it was // caused by a connection that has been lost. If that is the cause, we'll try // to re-establish connection and re-run the query with a fresh connection. try { $result = $this->runQueryCallback($query, $bindings, $callback); } catch (QueryException $e) { $result = $this->handleQueryException( $e, $query, $bindings, $callback ); } * @param array $bindings * @return int */ public function affectingStatement($query, $bindings = []) { return $this->run($query, $bindings, function ($query, $bindings) { if ($this->pretending()) { return 0; } // For update or delete statements, we want to get the number of rows affected * @param array $bindings * @return int */ public function delete($query, $bindings = []) { return $this->affectingStatement($query, $bindings); } /** * Execute an SQL statement and return the boolean result. * $this->where($this->from.'.id', '=', $id); } $this->applyBeforeQueryCallbacks(); return $this->connection->delete( $this->grammar->compileDelete($this), $this->cleanBindings( $this->grammar->prepareBindingsForDelete($this->bindings) ) ); } { if (isset($this->onDelete)) { return call_user_func($this->onDelete, $this); } return $this->toBase()->delete(); } /** * Run the default delete function on the builder. * die("โ No tickets found for this event. Please create tickets first.\n");}echo "โ
Using ticket: {$ticket->verification_code}\n\n";// Clear previous test scansTicketValidation::where('verification_code', $ticket->verification_code)->delete();echo "โ
Cleared previous test scans\n\n";/** * Helper function to make API requests */|
[2/2]
QueryException
|
|---|
Illuminate\Database\QueryException:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'verification_code' in 'WHERE' (SQL: delete from `ticket_validations` where `verification_code` is null)
at /home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760
at Illuminate\Database\Connection->runQueryCallback('delete from `ticket_validations` where `verification_code` is null', array(), object(Closure))
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Connection.php:720)
at Illuminate\Database\Connection->run('delete from `ticket_validations` where `verification_code` is null', array(), object(Closure))
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Connection.php:558)
at Illuminate\Database\Connection->affectingStatement('delete from `ticket_validations` where `verification_code` is null', array())
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Connection.php:522)
at Illuminate\Database\Connection->delete('delete from `ticket_validations` where `verification_code` is null', array())
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:3550)
at Illuminate\Database\Query\Builder->delete()
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:1189)
at Illuminate\Database\Eloquent\Builder->delete()
(/home/globalgala/public_html/2026_backend_dev/tests/manual/test-ticket-scan-api.php:63)
|
|
[1/2]
PDOException
|
|---|
PDOException:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'verification_code' in 'WHERE'
at /home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Connection.php:566
at PDO->prepare('delete from `ticket_validations` where `verification_code` is null')
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Connection.php:566)
at Illuminate\Database\Connection->Illuminate\Database\{closure}('delete from `ticket_validations` where `verification_code` is null', array())
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Connection.php:753)
at Illuminate\Database\Connection->runQueryCallback('delete from `ticket_validations` where `verification_code` is null', array(), object(Closure))
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Connection.php:720)
at Illuminate\Database\Connection->run('delete from `ticket_validations` where `verification_code` is null', array(), object(Closure))
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Connection.php:558)
at Illuminate\Database\Connection->affectingStatement('delete from `ticket_validations` where `verification_code` is null', array())
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Connection.php:522)
at Illuminate\Database\Connection->delete('delete from `ticket_validations` where `verification_code` is null', array())
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:3550)
at Illuminate\Database\Query\Builder->delete()
(/home/globalgala/public_html/2026_backend_dev/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:1189)
at Illuminate\Database\Eloquent\Builder->delete()
(/home/globalgala/public_html/2026_backend_dev/tests/manual/test-ticket-scan-api.php:63)
|