|
@@ -50,7 +50,7 @@ discard block |
|
|
block discarded – undo |
|
50
|
50
|
|
|
51
|
51
|
Log::channel('cust')->info('New Customer - '.$request->name.' created by '.Auth::user()->full_name); |
|
52
|
52
|
|
|
53
|
|
- return redirect(route('customers.show',$newCust->slug))->with(['message' => 'New Customer Created', 'type' => 'success']); |
|
|
53
|
+ return redirect(route('customers.show', $newCust->slug))->with(['message' => 'New Customer Created', 'type' => 'success']); |
|
54
|
54
|
} |
|
55
|
55
|
|
|
56
|
56
|
/** |
|
@@ -78,7 +78,7 @@ discard block |
|
|
block discarded – undo |
|
78
|
78
|
->with('CustomerFile.FileUpload') |
|
79
|
79
|
// ->with('ParentFile') |
|
80
|
80
|
->firstOrFail(); |
|
81
|
|
- $isFav = UserCustomerBookmark::where('user_id', Auth::user()->user_id) |
|
|
81
|
+ $isFav = UserCustomerBookmark::where('user_id', Auth::user()->user_id) |
|
82
|
82
|
->where('cust_id', $customer->cust_id) |
|
83
|
83
|
->count(); |
|
84
|
84
|
|
|
@@ -90,19 +90,19 @@ discard block |
|
|
block discarded – undo |
|
90
|
90
|
'phone_types' => PhoneNumberType::all(), |
|
91
|
91
|
'file_types' => CustomerFileType::all(), |
|
92
|
92
|
'user_functions' => [ |
|
93
|
|
- 'fav' => $isFav, // Customer is bookmarked by the user |
|
94
|
|
- 'edit' => Auth::user()->can('update', $customer), // User is allowed to edit the customers basic details |
|
95
|
|
- 'manage' => Auth::user()->can('manage', $customer), // User can recover deleted items |
|
96
|
|
- 'deactivate' => Auth::user()->can('delete', $customer), // User can deactivate the customer profile |
|
|
93
|
+ 'fav' => $isFav, // Customer is bookmarked by the user |
|
|
94
|
+ 'edit' => Auth::user()->can('update', $customer), // User is allowed to edit the customers basic details |
|
|
95
|
+ 'manage' => Auth::user()->can('manage', $customer), // User can recover deleted items |
|
|
96
|
+ 'deactivate' => Auth::user()->can('delete', $customer), // User can deactivate the customer profile |
|
97
|
97
|
'equipment' => [ |
|
98
|
|
- 'create' => Auth::user()->can('create', CustomerEquipment::class), // If user can add equipment |
|
99
|
|
- 'update' => Auth::user()->can('update', CustomerEquipment::class), // If user can edit equipment |
|
100
|
|
- 'delete' => Auth::user()->can('delete', CustomerEquipment::class), // If user can delete eqipment |
|
|
98
|
+ 'create' => Auth::user()->can('create', CustomerEquipment::class), // If user can add equipment |
|
|
99
|
+ 'update' => Auth::user()->can('update', CustomerEquipment::class), // If user can edit equipment |
|
|
100
|
+ 'delete' => Auth::user()->can('delete', CustomerEquipment::class), // If user can delete eqipment |
|
101
|
101
|
], |
|
102
|
102
|
'contacts' => [ |
|
103
|
|
- 'create' => Auth::user()->can('create', CustomerContact::class), // If user can add contact |
|
104
|
|
- 'update' => Auth::user()->can('update', CustomerContact::class), // If user can edit contact |
|
105
|
|
- 'delete' => Auth::user()->can('delete', CustomerContact::class), // If user can delete contact |
|
|
103
|
+ 'create' => Auth::user()->can('create', CustomerContact::class), // If user can add contact |
|
|
104
|
+ 'update' => Auth::user()->can('update', CustomerContact::class), // If user can edit contact |
|
|
105
|
+ 'delete' => Auth::user()->can('delete', CustomerContact::class), // If user can delete contact |
|
106
|
106
|
] |
|
107
|
107
|
], |
|
108
|
108
|
]); |