get last inserted row in Laravel eloquent

get last inserted row in Laravel eloquent with where and condition

<?php

$data = array();
  $lang = $request->lang;
  $reference_id = $request->reference_id;
  $call_state = $request->call_state;
  try{
    $data['incall'] = CalIncallWebhook::on($lang)->where(['call_state'=> $call_state,'reference_id'=> $reference_id])->latest()->first();
  }
  catch(Exception $ex)
  {
  
  }
 
 return $this->sendResponse($data, 'Successfully');   

?>

Discover more from Soa Technology | Aditya Website Development Designing Company

Subscribe to get the latest posts sent to your email.



Leave a Reply

Discover more from Soa Technology | Aditya Website Development Designing Company

Subscribe now to keep reading and get access to the full archive.

Continue reading