mercredi 31 janvier 2018

Unable to soft delete record when primaryKey column name is set to anything other than 'id'

I'm trying to solve this error since yesterday. My primary key column name is 'departmentId'

Whenever I try to delete the record by the code:

$department = departments::find($departmentId);
$department->delete();

It gives me a "converstion to string" error. As soon as I changed the Primary key column name to "id", it is working properly.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire