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.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2EqQr6Y
via IFTTT

Aucun commentaire:

Enregistrer un commentaire