|
@@ -54,7 +54,7 @@ discard block |
|
|
block discarded – undo |
|
54
|
54
|
$newCust = Customer::create($cust); |
|
55
|
55
|
|
|
56
|
56
|
event(new NewCustomerCreated($newCust)); |
|
57
|
|
- return redirect(route('customers.show',$newCust->slug))->with(['message' => 'New Customer Created', 'type' => 'success']); |
|
|
57
|
+ return redirect(route('customers.show', $newCust->slug))->with(['message' => 'New Customer Created', 'type' => 'success']); |
|
58
|
58
|
} |
|
59
|
59
|
|
|
60
|
60
|
/** |
|
@@ -84,7 +84,7 @@ discard block |
|
|
block discarded – undo |
|
84
|
84
|
->with('ParentFile.FileUpload') |
|
85
|
85
|
->firstOrFail(); |
|
86
|
86
|
// Determine if the customer is bookmarked by the user |
|
87
|
|
- $isFav = UserCustomerBookmark::where('user_id', Auth::user()->user_id) |
|
|
87
|
+ $isFav = UserCustomerBookmark::where('user_id', Auth::user()->user_id) |
|
88
|
88
|
->where('cust_id', $customer->cust_id) |
|
89
|
89
|
->count(); |
|
90
|
90
|
|
|
@@ -94,19 +94,19 @@ discard block |
|
|
block discarded – undo |
|
94
|
94
|
// 'file_types' => CustomerFileType::all(), |
|
95
|
95
|
// User Permissions for customers |
|
96
|
96
|
'user_data' => [ |
|
97
|
|
- 'fav' => $isFav, // Customer is bookmarked by the user |
|
98
|
|
- 'edit' => Auth::user()->can('update', $customer), // User is allowed to edit the customers basic details |
|
99
|
|
- 'manage' => Auth::user()->can('manage', $customer), // User can recover deleted items |
|
100
|
|
- 'deactivate' => Auth::user()->can('delete', $customer), // User can deactivate the customer profile |
|
|
97
|
+ 'fav' => $isFav, // Customer is bookmarked by the user |
|
|
98
|
+ 'edit' => Auth::user()->can('update', $customer), // User is allowed to edit the customers basic details |
|
|
99
|
+ 'manage' => Auth::user()->can('manage', $customer), // User can recover deleted items |
|
|
100
|
+ 'deactivate' => Auth::user()->can('delete', $customer), // User can deactivate the customer profile |
|
101
|
101
|
'equipment' => [ |
|
102
|
|
- 'create' => Auth::user()->can('create', CustomerEquipment::class), // If user can add equipment |
|
103
|
|
- 'update' => Auth::user()->can('update', CustomerEquipment::class), // If user can edit equipment |
|
104
|
|
- 'delete' => Auth::user()->can('delete', CustomerEquipment::class), // If user can delete eqipment |
|
|
102
|
+ 'create' => Auth::user()->can('create', CustomerEquipment::class), // If user can add equipment |
|
|
103
|
+ 'update' => Auth::user()->can('update', CustomerEquipment::class), // If user can edit equipment |
|
|
104
|
+ 'delete' => Auth::user()->can('delete', CustomerEquipment::class), // If user can delete eqipment |
|
105
|
105
|
], |
|
106
|
106
|
'contacts' => [ |
|
107
|
|
- 'create' => Auth::user()->can('create', CustomerContact::class), // If user can add contact |
|
108
|
|
- 'update' => Auth::user()->can('update', CustomerContact::class), // If user can edit contact |
|
109
|
|
- 'delete' => Auth::user()->can('delete', CustomerContact::class), // If user can delete contact |
|
|
107
|
+ 'create' => Auth::user()->can('create', CustomerContact::class), // If user can add contact |
|
|
108
|
+ 'update' => Auth::user()->can('update', CustomerContact::class), // If user can edit contact |
|
|
109
|
+ 'delete' => Auth::user()->can('delete', CustomerContact::class), // If user can delete contact |
|
110
|
110
|
], |
|
111
|
111
|
// 'notes' => [ |
|
112
|
112
|
// 'create' => Auth::user()->can('create', CustomerNote::class), // If user can add note |