Subject Problem with Laravel Driver and Laravel Passport
Author Luis Nicotra

Hi! I have an app using Laravel 5.5 and a Firebird 3.0 database. Everything worked well until i needed to extend the app and required the Laravel Passport package for API Auth. When installing the package I got the next error:

SQLSTATE[IM001]: Driver does not support this function: driver does not support lastInsertId()

following the stacktrace I see that the method used for the package i (in PHP):

public function processInsertGetId(Builder $query, $sql, $values, $sequence = null)

{
    $query->getConnection()->insert($sql, $values);

    $id = $query->getConnection()->getPdo()->lastInsertId($sequence);

    return is_numeric($id) ? (int) $id : $id;
}

it uses lastInsertId() method wich is not supported by the driver.
For my custom Models of the app i fixed the lastinsertid problem by using a direct query with the generator of the table referred by the model. In this particular case I don't know what is the table used (Laravel Passport package creates many tables for it's own use) so I can't use my custom fix to hardwire the method. I need a way to get last inserted id of the last query executed in the database from php and i'm stuck here.
Maybe some of you used Laravel Passport and Firebird together and know how to fix this problem. The laravel driver I'm using is https://github.com/jacquestvanzuydam/laravel-firebird.
Apologies for any mispellings.

--
Luis Nicotra
Departamento de Informática
DASU - Obra Social del Personal de la Universidad Nacional de la Patagonia
Comodoro Rivadavia, Chubut, Argentina
Teléfono (0297) 446-4444 int. 103 (de 8 a 16 hs)
Correo electrónico: lnicotra@...
Website: www.dasu.com.ar


--
Antes de imprimir este mensaje, piense si es verdaderamente necesario hacerlo.