mardi 3 mai 2016

Transaction () - Query Builder in laravel 5 throwing error

Trying to make an API using Transaction() for making more security for database.

Code :

try {

PostCustomer::transaction(function()
{
$CheckExistingData = PostCustomer::select('Mobile')->where('Mobile',$Mobile);   
return $CheckExistingData;
});

}
catch (Exception $e)
{

PostCustomer::rollback();
PostCustomer::commit();

}

Error :

BadMethodCallException in Builder.php line 2258:

Call to undefined method Illuminate\Database\Query\Builder::transaction()

Share your thoughts!



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

Aucun commentaire:

Enregistrer un commentaire