@@ -54,7 +54,7 @@ discard block |
||
| 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 |
||
| 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,29 +94,29 @@ discard block |
||
| 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 | - 'create' => Auth::user()->can('create', CustomerNote::class), // If user can add note |
|
| 113 | - 'update' => Auth::user()->can('update', CustomerNote::class), // If user can edit note |
|
| 114 | - 'delete' => Auth::user()->can('delete', CustomerNote::class), // If user can delete note |
|
| 112 | + 'create' => Auth::user()->can('create', CustomerNote::class), // If user can add note |
|
| 113 | + 'update' => Auth::user()->can('update', CustomerNote::class), // If user can edit note |
|
| 114 | + 'delete' => Auth::user()->can('delete', CustomerNote::class), // If user can delete note |
|
| 115 | 115 | ], |
| 116 | 116 | 'files' => [ |
| 117 | - 'create' => Auth::user()->can('create', CustomerFile::class), // If user can add file |
|
| 118 | - 'update' => Auth::user()->can('update', CustomerFile::class), // If user can edit file |
|
| 119 | - 'delete' => Auth::user()->can('delete', CustomerFile::class), // If user can delete file |
|
| 117 | + 'create' => Auth::user()->can('create', CustomerFile::class), // If user can add file |
|
| 118 | + 'update' => Auth::user()->can('update', CustomerFile::class), // If user can edit file |
|
| 119 | + 'delete' => Auth::user()->can('delete', CustomerFile::class), // If user can delete file |
|
| 120 | 120 | ], |
| 121 | 121 | ], |
| 122 | 122 | ]); |
@@ -15,8 +15,7 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | public function adminLink(User $user) |
| 17 | 17 | { |
| 18 | - $userRole = UserRolePermissions::whereRoleId($user->role_id)->whereHas('UserRolePermissionTypes', function($q) |
|
| 19 | - { |
|
| 18 | + $userRole = UserRolePermissions::whereRoleId($user->role_id)->whereHas('UserRolePermissionTypes', function($q) { |
|
| 20 | 19 | $q->whereIsAdminLink(1); |
| 21 | 20 | })->whereAllow(1)->count(); |
| 22 | 21 | |