@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | Log::channel('cust')->info('New Customer - '.$request->name.' created by '.Auth::user()->full_name); |
| 55 | 55 | |
| 56 | - return redirect(route('customers.show',$newCust->slug))->with(['message' => 'New Customer Created', 'type' => 'success']); |
|
| 56 | + return redirect(route('customers.show', $newCust->slug))->with(['message' => 'New Customer Created', 'type' => 'success']); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | ->with('CustomerFile.FileUpload') |
| 82 | 82 | ->with('ParentFile.FileUpload') |
| 83 | 83 | ->firstOrFail(); |
| 84 | - $isFav = UserCustomerBookmark::where('user_id', Auth::user()->user_id) |
|
| 84 | + $isFav = UserCustomerBookmark::where('user_id', Auth::user()->user_id) |
|
| 85 | 85 | ->where('cust_id', $customer->cust_id) |
| 86 | 86 | ->count(); |
| 87 | 87 | |
@@ -90,29 +90,29 @@ discard block |
||
| 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 | 'notes' => [ |
| 108 | - 'create' => Auth::user()->can('create', CustomerNote::class), // If user can add note |
|
| 109 | - 'update' => Auth::user()->can('update', CustomerNote::class), // If user can edit note |
|
| 110 | - 'delete' => Auth::user()->can('delete', CustomerNote::class), // If user can delete note |
|
| 108 | + 'create' => Auth::user()->can('create', CustomerNote::class), // If user can add note |
|
| 109 | + 'update' => Auth::user()->can('update', CustomerNote::class), // If user can edit note |
|
| 110 | + 'delete' => Auth::user()->can('delete', CustomerNote::class), // If user can delete note |
|
| 111 | 111 | ], |
| 112 | 112 | 'files' => [ |
| 113 | - 'create' => Auth::user()->can('create', CustomerFile::class), // If user can add file |
|
| 114 | - 'update' => Auth::user()->can('update', CustomerFile::class), // If user can edit file |
|
| 115 | - 'delete' => Auth::user()->can('delete', CustomerFile::class), // If user can delete file |
|
| 113 | + 'create' => Auth::user()->can('create', CustomerFile::class), // If user can add file |
|
| 114 | + 'update' => Auth::user()->can('update', CustomerFile::class), // If user can edit file |
|
| 115 | + 'delete' => Auth::user()->can('delete', CustomerFile::class), // If user can delete file |
|
| 116 | 116 | ], |
| 117 | 117 | ], |
| 118 | 118 | ]); |
@@ -78,8 +78,7 @@ |
||
| 78 | 78 | $cust = Customer::findOrFail($id); |
| 79 | 79 | |
| 80 | 80 | return CustomerFile::where('cust_id', $id) |
| 81 | - ->when($cust->parent_id, function($q) use ($cust) |
|
| 82 | - { |
|
| 81 | + ->when($cust->parent_id, function($q) use ($cust) { |
|
| 83 | 82 | $q->orWhere('cust_id', $cust->parent_id)->where('shared', true); |
| 84 | 83 | }) |
| 85 | 84 | ->with('FileUpload') |