VimKanzo

Illuminate\Database\QueryException: SQLSTATE[42S22]: Column not found: 1054 Unknown column in

laravel Icon

Illuminate\Database\QueryException

SQLSTATE[42S22]: Column not found: 1054 Unknown column in

An unhandled exception occurred on line 678
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
            );

Solution

I was using eloquent Were to get a user role by doing whereRoleId, but instead I mistakenly had it written with a capital ID which wasn't supposed to be so as it didn't match the table column name.            
Apr 11, 2021 Anyone

0 replies


Install the browser extension

Found this solution helpful? Try our extension for quick solutions to your Laravel errors.

Chrome logo Add to Chrome - It's free