@@ -64,7 +64,7 @@ |
||
64 | 64 | // Sanitize the filename to remove any illegal characters and spaces |
65 | 65 | protected function cleanFilename($name) |
66 | 66 | { |
67 | - $newName = str_replace(' ', '_', preg_replace("([^\w\s\d\-_~,;\[\]\(\).])", '', $name)); |
|
67 | + $newName = str_replace(' ', '_', preg_replace("([^\w\s\d\-_~,;\[\]\(\).])", '', $name)); |
|
68 | 68 | Log::debug('Cleaned Filename', ['original_name' => $name, 'clean_name' => $newName]); |
69 | 69 | |
70 | 70 | return $newName; |
@@ -63,8 +63,7 @@ |
||
63 | 63 | |
64 | 64 | return CustomerContact::where('cust_id', $id) |
65 | 65 | ->with('CustomerContactPhone.PhoneNumberType') |
66 | - ->when($cust->parent_id, function($q) use ($cust) |
|
67 | - { |
|
66 | + ->when($cust->parent_id, function($q) use ($cust) { |
|
68 | 67 | $q->orWhere('cust_id', $cust->parent_id)->where('shared', true); |
69 | 68 | }) |
70 | 69 | ->get(); |
@@ -46,8 +46,7 @@ |
||
46 | 46 | $cust = Customer::findOrFail($id); |
47 | 47 | |
48 | 48 | return CustomerNote::where('cust_id', $id) |
49 | - ->when($cust->parent_id, function($q) use ($cust) |
|
50 | - { |
|
49 | + ->when($cust->parent_id, function($q) use ($cust) { |
|
51 | 50 | $q->orWhere('cust_id', $cust->parent_id)->where('shared', true); |
52 | 51 | }) |
53 | 52 | ->orderBy('urgent', 'DESC') |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | Log::channel('cust')->info('New Customer - '.$request->name.' created by '.Auth::user()->full_name); |
53 | 53 | |
54 | - return redirect(route('customers.show',$newCust->slug))->with(['message' => 'New Customer Created', 'type' => 'success']); |
|
54 | + return redirect(route('customers.show', $newCust->slug))->with(['message' => 'New Customer Created', 'type' => 'success']); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | ->with('CustomerFile.FileUpload') |
80 | 80 | // ->with('ParentFile') |
81 | 81 | ->firstOrFail(); |
82 | - $isFav = UserCustomerBookmark::where('user_id', Auth::user()->user_id) |
|
82 | + $isFav = UserCustomerBookmark::where('user_id', Auth::user()->user_id) |
|
83 | 83 | ->where('cust_id', $customer->cust_id) |
84 | 84 | ->count(); |
85 | 85 | |
@@ -91,24 +91,24 @@ discard block |
||
91 | 91 | 'phone_types' => PhoneNumberType::all(), |
92 | 92 | 'file_types' => CustomerFileType::all(), |
93 | 93 | 'user_functions' => [ |
94 | - 'fav' => $isFav, // Customer is bookmarked by the user |
|
95 | - 'edit' => Auth::user()->can('update', $customer), // User is allowed to edit the customers basic details |
|
96 | - 'manage' => Auth::user()->can('manage', $customer), // User can recover deleted items |
|
97 | - 'deactivate' => Auth::user()->can('delete', $customer), // User can deactivate the customer profile |
|
94 | + 'fav' => $isFav, // Customer is bookmarked by the user |
|
95 | + 'edit' => Auth::user()->can('update', $customer), // User is allowed to edit the customers basic details |
|
96 | + 'manage' => Auth::user()->can('manage', $customer), // User can recover deleted items |
|
97 | + 'deactivate' => Auth::user()->can('delete', $customer), // User can deactivate the customer profile |
|
98 | 98 | 'equipment' => [ |
99 | - 'create' => Auth::user()->can('create', CustomerEquipment::class), // If user can add equipment |
|
100 | - 'update' => Auth::user()->can('update', CustomerEquipment::class), // If user can edit equipment |
|
101 | - 'delete' => Auth::user()->can('delete', CustomerEquipment::class), // If user can delete eqipment |
|
99 | + 'create' => Auth::user()->can('create', CustomerEquipment::class), // If user can add equipment |
|
100 | + 'update' => Auth::user()->can('update', CustomerEquipment::class), // If user can edit equipment |
|
101 | + 'delete' => Auth::user()->can('delete', CustomerEquipment::class), // If user can delete eqipment |
|
102 | 102 | ], |
103 | 103 | 'contacts' => [ |
104 | - 'create' => Auth::user()->can('create', CustomerContact::class), // If user can add contact |
|
105 | - 'update' => Auth::user()->can('update', CustomerContact::class), // If user can edit contact |
|
106 | - 'delete' => Auth::user()->can('delete', CustomerContact::class), // If user can delete contact |
|
104 | + 'create' => Auth::user()->can('create', CustomerContact::class), // If user can add contact |
|
105 | + 'update' => Auth::user()->can('update', CustomerContact::class), // If user can edit contact |
|
106 | + 'delete' => Auth::user()->can('delete', CustomerContact::class), // If user can delete contact |
|
107 | 107 | ], |
108 | 108 | 'notes' => [ |
109 | - 'create' => Auth::user()->can('create', CustomerNote::class), // If user can add note |
|
110 | - 'update' => Auth::user()->can('update', CustomerNote::class), // If user can edit note |
|
111 | - 'delete' => Auth::user()->can('delete', CustomerNote::class), // If user can delete note |
|
109 | + 'create' => Auth::user()->can('create', CustomerNote::class), // If user can add note |
|
110 | + 'update' => Auth::user()->can('update', CustomerNote::class), // If user can edit note |
|
111 | + 'delete' => Auth::user()->can('delete', CustomerNote::class), // If user can delete note |
|
112 | 112 | ], |
113 | 113 | ], |
114 | 114 | ]); |