@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | */ |
16 | 16 | public function up() |
17 | 17 | { |
18 | - Schema::create('user_role_permission_types', function (Blueprint $table) { |
|
18 | + Schema::create('user_role_permission_types', function(Blueprint $table) { |
|
19 | 19 | $table->increments('perm_type_id'); |
20 | 20 | $table->text('description'); |
21 | 21 | $table->timestamps(); |
@@ -23,17 +23,17 @@ discard block |
||
23 | 23 | |
24 | 24 | // Insert default data |
25 | 25 | DB::table('user_role_permission_types')->insert([ |
26 | - ['perm_type_id' => 1, 'description' => 'Manage Users', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
27 | - ['perm_type_id' => 2, 'description' => 'Manage User Roles', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
28 | - ['perm_type_id' => 3, 'description' => 'Run Reports', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
29 | - ['perm_type_id' => 4, 'description' => 'Add Customer', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
30 | - ['perm_type_id' => 5, 'description' => 'Manage Customers', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
31 | - ['perm_type_id' => 6, 'description' => 'Deactivate Customer', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
32 | - ['perm_type_id' => 7, 'description' => 'Use File Links', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
33 | - ['perm_type_id' => 8, 'description' => 'Create Tech Tip', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
34 | - ['perm_type_id' => 9, 'description' => 'Edit Tech Tip', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
35 | - ['perm_type_id' => 10, 'description' => 'Delete Tech Tip', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
36 | - ['perm_type_id' => 11, 'description' => 'Manage Equipment', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
26 | + ['perm_type_id' => 1, 'description' => 'Manage Users', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
27 | + ['perm_type_id' => 2, 'description' => 'Manage User Roles', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
28 | + ['perm_type_id' => 3, 'description' => 'Run Reports', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
29 | + ['perm_type_id' => 4, 'description' => 'Add Customer', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
30 | + ['perm_type_id' => 5, 'description' => 'Manage Customers', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
31 | + ['perm_type_id' => 6, 'description' => 'Deactivate Customer', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
32 | + ['perm_type_id' => 7, 'description' => 'Use File Links', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
33 | + ['perm_type_id' => 8, 'description' => 'Create Tech Tip', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
34 | + ['perm_type_id' => 9, 'description' => 'Edit Tech Tip', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
35 | + ['perm_type_id' => 10, 'description' => 'Delete Tech Tip', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
36 | + ['perm_type_id' => 11, 'description' => 'Manage Equipment', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()], |
|
37 | 37 | ]); |
38 | 38 | } |
39 | 39 |
@@ -36,13 +36,13 @@ discard block |
||
36 | 36 | // Determine if a user can see the Administration Nav Link |
37 | 37 | public function seeAdminLink(User $user) |
38 | 38 | { |
39 | - if ($this->isInstaller($user)) |
|
39 | + if($this->isInstaller($user)) |
|
40 | 40 | { |
41 | 41 | return true; |
42 | 42 | } |
43 | 43 | |
44 | 44 | $data = UserRolePermissions::with('UserRolePermissionTypes') |
45 | - ->whereHas('UserRolePermissionTypes', function ($query) { |
|
45 | + ->whereHas('UserRolePermissionTypes', function($query) { |
|
46 | 46 | $query->where('description', 'Manage Users') |
47 | 47 | ->orWhere('description', 'Manage User Roles') |
48 | 48 | ->orWhere('description', 'Manage Customers') |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | ->get(); |
54 | 54 | |
55 | 55 | $allow = $data->isEmpty() ? 'false' : 'true'; |
56 | - \Log::debug('User ' . $user->full_name . ' is trying to access admin link. Result - ' . $allow); |
|
56 | + \Log::debug('User '.$user->full_name.' is trying to access admin link. Result - '.$allow); |
|
57 | 57 | |
58 | 58 | return $data->isEmpty() ? false : true; |
59 | 59 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | $data = UserRolePermissions::with('UserRolePermissionTypes') |
71 | - ->whereHas('UserRolePermissionTypes', function ($query) use ($task) { |
|
71 | + ->whereHas('UserRolePermissionTypes', function($query) use ($task) { |
|
72 | 72 | $query->where('description', $task); |
73 | 73 | }) |
74 | 74 | ->where('role_id', $user->role_id) |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | ->get(); |
77 | 77 | |
78 | 78 | $allow = $data->isEmpty() ? 'false' : 'true'; |
79 | - \Log::debug('User '.$user->full_name.' is trying to access '.$task.'. Result - ' . $allow); |
|
79 | + \Log::debug('User '.$user->full_name.' is trying to access '.$task.'. Result - '.$allow); |
|
80 | 80 | |
81 | 81 | return $data->isEmpty() ? false : true; |
82 | 82 | } |
@@ -8,59 +8,59 @@ discard block |
||
8 | 8 | /* |
9 | 9 | * Non user Routes |
10 | 10 | */ |
11 | -Route::get('/', 'Auth\LoginController@showLoginForm')->name('index'); |
|
12 | -Route::get('logout', 'Auth\LoginController@logout') ->name('logout'); |
|
11 | +Route::get('/', 'Auth\LoginController@showLoginForm')->name('index'); |
|
12 | +Route::get('logout', 'Auth\LoginController@logout') ->name('logout'); |
|
13 | 13 | Route::get('no-script', 'Controller@noScript') ->name('noscript'); |
14 | 14 | |
15 | 15 | /* |
16 | 16 | * Download File Routes |
17 | 17 | */ |
18 | -Route::get('download/{id}/{filename}', 'DownloadController@index') ->name('download'); |
|
18 | +Route::get('download/{id}/{filename}', 'DownloadController@index') ->name('download'); |
|
19 | 19 | Route::get('download-archive/{filename}', 'DownloadController@downloadArchive')->name('downloadArchive'); |
20 | -Route::put('download-archive', 'DownloadController@archiveFiles') ->name('archiveFiles'); |
|
20 | +Route::put('download-archive', 'DownloadController@archiveFiles') ->name('archiveFiles'); |
|
21 | 21 | |
22 | 22 | /* |
23 | 23 | * User Settings Routes |
24 | 24 | */ |
25 | -Route::get('account', 'AccountController@index') ->name('account'); |
|
26 | -Route::post('account', 'AccountController@submit') ->name('account'); |
|
27 | -Route::put('account', 'AccountController@notifications') ->name('account'); |
|
28 | -Route::get('/account/change-password', 'AccountController@changePassword')->name('changePassword'); |
|
25 | +Route::get('account', 'AccountController@index') ->name('account'); |
|
26 | +Route::post('account', 'AccountController@submit') ->name('account'); |
|
27 | +Route::put('account', 'AccountController@notifications') ->name('account'); |
|
28 | +Route::get('/account/change-password', 'AccountController@changePassword')->name('changePassword'); |
|
29 | 29 | Route::post('/account/change-password', 'AccountController@submitPassword')->name('changePassword'); |
30 | 30 | |
31 | 31 | /* |
32 | 32 | * Basic Logged In Routes |
33 | 33 | */ |
34 | -Route::get('about', 'DashboardController@about') ->name('about'); |
|
35 | -Route::get('dashboard', 'DashboardController@index') ->name('dashboard'); |
|
36 | -Route::get('notifications', 'DashboardController@getNotifications')->name('getNotifications'); |
|
34 | +Route::get('about', 'DashboardController@about') ->name('about'); |
|
35 | +Route::get('dashboard', 'DashboardController@index') ->name('dashboard'); |
|
36 | +Route::get('notifications', 'DashboardController@getNotifications')->name('getNotifications'); |
|
37 | 37 | Route::get('mark-notification/{id}', 'DashboardController@markNotification')->name('markNotification'); |
38 | -Route::delete('notifications/{id}', 'DashboardController@delNotification') ->name('delNotification'); |
|
38 | +Route::delete('notifications/{id}', 'DashboardController@delNotification') ->name('delNotification'); |
|
39 | 39 | |
40 | 40 | /* |
41 | 41 | * File Link Routes |
42 | 42 | */ |
43 | -Route::prefix('links')->name('links.')->group(function () { |
|
43 | +Route::prefix('links')->name('links.')->group(function() { |
|
44 | 44 | // Resource controllers for base access |
45 | - Route::resource('data', 'FileLinks\FileLinksController'); |
|
46 | - Route::get('new', 'FileLinks\FileLinksController@create') ->name('new'); |
|
47 | - Route::get('find/{id}', 'FileLinks\FileLinksController@find') ->name('user'); |
|
45 | + Route::resource('data', 'FileLinks\FileLinksController'); |
|
46 | + Route::get('new', 'FileLinks\FileLinksController@create') ->name('new'); |
|
47 | + Route::get('find/{id}', 'FileLinks\FileLinksController@find') ->name('user'); |
|
48 | 48 | Route::get('details/{id}/{name}', 'FileLinks\FileLinksController@details') ->name('details'); |
49 | - Route::get('disable/{id}', 'FileLinks\FileLinksController@disableLink')->name('disable'); |
|
49 | + Route::get('disable/{id}', 'FileLinks\FileLinksController@disableLink')->name('disable'); |
|
50 | 50 | // File Link Files |
51 | - Route::resource('files', 'FileLinks\LinkFilesController'); |
|
51 | + Route::resource('files', 'FileLinks\LinkFilesController'); |
|
52 | 52 | // Index landing page |
53 | - Route::get('/', 'FileLinks\FileLinksController@index') ->name('index'); |
|
53 | + Route::get('/', 'FileLinks\FileLinksController@index') ->name('index'); |
|
54 | 54 | }); |
55 | 55 | |
56 | 56 | /* |
57 | 57 | * Guest File Link Routes |
58 | 58 | */ |
59 | 59 | Route::get('file-links/{id}/get-files', 'FileLinks\GuestLinksController@getFiles')->name('file-links.getFiles'); |
60 | -Route::put('file-links/{id}', 'FileLinks\GuestLinksController@notify') ->name('file-links.show'); |
|
61 | -Route::post('file-links/{id}', 'FileLinks\GuestLinksController@update') ->name('file-links.show'); |
|
62 | -Route::get('file-links/{id}', 'FileLinks\GuestLinksController@show') ->name('file-links.show'); |
|
63 | -Route::get('file-links', 'FileLinks\GuestLinksController@index') ->name('file-links.index'); |
|
60 | +Route::put('file-links/{id}', 'FileLinks\GuestLinksController@notify') ->name('file-links.show'); |
|
61 | +Route::post('file-links/{id}', 'FileLinks\GuestLinksController@update') ->name('file-links.show'); |
|
62 | +Route::get('file-links/{id}', 'FileLinks\GuestLinksController@show') ->name('file-links.show'); |
|
63 | +Route::get('file-links', 'FileLinks\GuestLinksController@index') ->name('file-links.index'); |
|
64 | 64 | |
65 | 65 | /* |
66 | 66 | * Customer Routes |
@@ -68,44 +68,44 @@ discard block |
||
68 | 68 | Route::prefix('customer')->name('customer.')->group(function() |
69 | 69 | { |
70 | 70 | // Customer Files |
71 | - Route::resource('files', 'Customers\CustomerFilesController'); |
|
71 | + Route::resource('files', 'Customers\CustomerFilesController'); |
|
72 | 72 | // Custome Notes |
73 | - Route::get('download-note/{id}', 'DownloadController@downloadCustNote') ->name('download-note'); |
|
74 | - Route::resource('notes', 'Customers\CustomerNotesController'); |
|
73 | + Route::get('download-note/{id}', 'DownloadController@downloadCustNote') ->name('download-note'); |
|
74 | + Route::resource('notes', 'Customers\CustomerNotesController'); |
|
75 | 75 | // Customer Contacts |
76 | - Route::resource('contacts', 'Customers\CustomerContactsController'); |
|
76 | + Route::resource('contacts', 'Customers\CustomerContactsController'); |
|
77 | 77 | // Customer Systems |
78 | - Route::resource('systems', 'Customers\CustomerSystemsController'); |
|
78 | + Route::resource('systems', 'Customers\CustomerSystemsController'); |
|
79 | 79 | // Customer Details |
80 | - Route::get('id/{id}/{name}', 'Customers\CustomerDetailsController@details')->name('details'); |
|
81 | - Route::resource('id', 'Customers\CustomerDetailsController'); |
|
80 | + Route::get('id/{id}/{name}', 'Customers\CustomerDetailsController@details')->name('details'); |
|
81 | + Route::resource('id', 'Customers\CustomerDetailsController'); |
|
82 | 82 | // check Id and bookmark customer |
83 | 83 | Route::get('toggle-fav/{action}/{custID}', 'Customers\CustomerController@toggleFav') ->name('toggle-fav'); |
84 | - Route::get('check-id/{id}', 'Customers\CustomerController@checkID') ->name('check-id'); |
|
84 | + Route::get('check-id/{id}', 'Customers\CustomerController@checkID') ->name('check-id'); |
|
85 | 85 | // Index landing/search page |
86 | - Route::get('search', 'Customers\CustomerController@search') ->name('search'); |
|
87 | - Route::get('/', 'Customers\CustomerController@index') ->name('index'); |
|
86 | + Route::get('search', 'Customers\CustomerController@search') ->name('search'); |
|
87 | + Route::get('/', 'Customers\CustomerController@index') ->name('index'); |
|
88 | 88 | }); |
89 | 89 | |
90 | 90 | /* |
91 | 91 | * Tech Tip Routes |
92 | 92 | */ |
93 | -Route::resource('tips', 'TechTips\TechTipsController'); |
|
94 | -Route::post('submit-edit/{id}', 'TechTips\TechTipsController@update') ->name('tips.submit-edit'); |
|
93 | +Route::resource('tips', 'TechTips\TechTipsController'); |
|
94 | +Route::post('submit-edit/{id}', 'TechTips\TechTipsController@update') ->name('tips.submit-edit'); |
|
95 | 95 | Route::prefix('tip')->name('tip.')->group(function() |
96 | 96 | { |
97 | - Route::resource('comments', 'TechTips\TechTipCommentsController'); |
|
98 | - Route::get('search', 'TechTips\TechTipsController@search') ->name('search'); |
|
99 | - Route::get('details/{id}/{name}', 'TechTips\TechTipsController@details') ->name('details'); |
|
100 | - Route::post('process-image', 'TechTips\TechTipsController@processImage')->name('processImage'); |
|
97 | + Route::resource('comments', 'TechTips\TechTipCommentsController'); |
|
98 | + Route::get('search', 'TechTips\TechTipsController@search') ->name('search'); |
|
99 | + Route::get('details/{id}/{name}', 'TechTips\TechTipsController@details') ->name('details'); |
|
100 | + Route::post('process-image', 'TechTips\TechTipsController@processImage')->name('processImage'); |
|
101 | 101 | Route::get('toggle-fav/{action}/{tipID}', 'TechTips\TechTipsController@toggleFav') ->name('toggle-fav'); |
102 | - Route::get('download-tip/{id}', 'DownloadController@downloadTechTip') ->name('downloadTip'); |
|
102 | + Route::get('download-tip/{id}', 'DownloadController@downloadTechTip') ->name('downloadTip'); |
|
103 | 103 | }); |
104 | 104 | |
105 | 105 | /* |
106 | 106 | * Administration Routes |
107 | 107 | */ |
108 | -Route::prefix('admin')->name('admin.')->group(function () { |
|
108 | +Route::prefix('admin')->name('admin.')->group(function() { |
|
109 | 109 | |
110 | 110 | |
111 | 111 |