08 2024
This commit is contained in:
parent
c1c613a4b9
commit
881fc84207
384 changed files with 50679 additions and 990 deletions
|
|
@ -3,8 +3,9 @@
|
|||
namespace App\Repositories;
|
||||
|
||||
|
||||
use App\Models\Customer;
|
||||
use App\Models\Lead;
|
||||
use App\Models\Booking;
|
||||
use App\Models\Customer;
|
||||
|
||||
class CustomerRepository extends BaseRepository {
|
||||
|
||||
|
|
@ -22,7 +23,7 @@ class CustomerRepository extends BaseRepository {
|
|||
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
//by Lead ID
|
||||
public function updateCustomerFromLead($id, $data){
|
||||
|
||||
$lead = Lead::findOrFail($id);
|
||||
|
|
@ -30,5 +31,14 @@ class CustomerRepository extends BaseRepository {
|
|||
return $this->updateCustomer($lead->customer->id, $data['customer']);
|
||||
}
|
||||
}
|
||||
//by Booking ID
|
||||
public function updateCustomerFromBooking($id, $data){
|
||||
|
||||
$booking = Booking::findOrFail($id);
|
||||
if(isset($data['customer']) && $booking->customer){
|
||||
return $this->updateCustomer($booking->customer->id, $data['customer']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue