I have the following function that creates a new record in the database, if it does not already exist - if it exists, it updates it. The problem is that it returns true, and therefore I cannot get the ID of the inserted or updated record.
public function saveTimesheet($token, $data)
{
return $this->timesheet->firstOrNew($token)->fill($data)->save();
}
source
share