@@ -10,11 +10,11 @@  | 
                                                    ||
| 10 | 10 | |
| 11 | 11 | public function handle($export)  | 
                                                        
| 12 | 12 |      { | 
                                                        
| 13 | -        return $export->sheet('User-Training', function ($sheet) { | 
                                                        |
| 13 | +        return $export->sheet('User-Training', function($sheet) { | 
                                                        |
| 14 | 14 | |
| 15 | 15 | $trainings = Training::all();  | 
                                                        
| 16 | 16 | $users = User::skipSystem()->with([  | 
                                                        
| 17 | -                'assignedTrainings' => function ($q) { | 
                                                        |
| 17 | +                'assignedTrainings' => function($q) { | 
                                                        |
| 18 | 18 |                      $q->whereNotNull('completed_date')->orderBy('completed_date', 'desc'); | 
                                                        
| 19 | 19 | }  | 
                                                        
| 20 | 20 |              ])->active()->orderBy('last_name')->get(); | 
                                                        
@@ -30,7 +30,7 @@ discard block  | 
                                                    ||
| 30 | 30 |          $this->authorize('view'); | 
                                                        
| 31 | 31 | |
| 32 | 32 | $groups = Group::with([  | 
                                                        
| 33 | -            'users' => function ($q) { | 
                                                        |
| 33 | +            'users' => function($q) { | 
                                                        |
| 34 | 34 |                  $q->orderBy('last_name'); | 
                                                        
| 35 | 35 | },  | 
                                                        
| 36 | 36 | 'trainings'  | 
                                                        
@@ -122,7 +122,7 @@ discard block  | 
                                                    ||
| 122 | 122 | return "nothing sent.";  | 
                                                        
| 123 | 123 | }  | 
                                                        
| 124 | 124 | |
| 125 | -        return User::whereHas('groups', function ($query) use ($request) { | 
                                                        |
| 125 | +        return User::whereHas('groups', function($query) use ($request) { | 
                                                        |
| 126 | 126 |              $query->whereIn('id', $request['groups']); | 
                                                        
| 127 | 127 |          })->pluck('id'); | 
                                                        
| 128 | 128 | }  | 
                                                        
@@ -115,7 +115,7 @@  | 
                                                    ||
| 115 | 115 |      { | 
                                                        
| 116 | 116 |          $this->authorize('edit'); | 
                                                        
| 117 | 117 | |
| 118 | -        Storage::deleteDirectory('news_'.$news->id); | 
                                                        |
| 118 | +        Storage::deleteDirectory('news_' . $news->id); | 
                                                        |
| 119 | 119 | $news->delete();  | 
                                                        
| 120 | 120 | }  | 
                                                        
| 121 | 121 | |
@@ -62,7 +62,7 @@  | 
                                                    ||
| 62 | 62 |      { | 
                                                        
| 63 | 63 | |
| 64 | 64 | Note::find($noteId)->delete();  | 
                                                        
| 65 | -        Storage::deleteDirectory('note_'.$noteId); | 
                                                        |
| 65 | +        Storage::deleteDirectory('note_' . $noteId); | 
                                                        |
| 66 | 66 | |
| 67 | 67 | return back();  | 
                                                        
| 68 | 68 | }  | 
                                                        
@@ -60,7 +60,7 @@  | 
                                                    ||
| 60 | 60 | public function destroy($userID, $travelID)  | 
                                                        
| 61 | 61 |      { | 
                                                        
| 62 | 62 | Travel::findOrFail($travelID)->delete();  | 
                                                        
| 63 | -        Storage::deleteDirectory('travel_'.$travelID); | 
                                                        |
| 63 | +        Storage::deleteDirectory('travel_' . $travelID); | 
                                                        |
| 64 | 64 | |
| 65 | 65 | return Redirect::back();  | 
                                                        
| 66 | 66 | }  | 
                                                        
@@ -32,34 +32,34 @@  | 
                                                    ||
| 32 | 32 | $this->registerPolicies($gate);  | 
                                                        
| 33 | 33 | |
| 34 | 34 | //user can edit this. AKA, they are an admin.  | 
                                                        
| 35 | -        $gate->define('edit', function ($user) { | 
                                                        |
| 35 | +        $gate->define('edit', function($user) { | 
                                                        |
| 36 | 36 | return $this->isAdmin($user);  | 
                                                        
| 37 | 37 | });  | 
                                                        
| 38 | 38 | |
| 39 | 39 | //user has view rights  | 
                                                        
| 40 | -        $gate->define('view', function ($user) { | 
                                                        |
| 40 | +        $gate->define('view', function($user) { | 
                                                        |
| 41 | 41 | return $this->isViewer($user);  | 
                                                        
| 42 | 42 | });  | 
                                                        
| 43 | 43 | |
| 44 | 44 | //Let admin update note & user update training note.  | 
                                                        
| 45 | -        $gate->define('update_record', function ($user, $record) { | 
                                                        |
| 45 | +        $gate->define('update_record', function($user, $record) { | 
                                                        |
| 46 | 46 | return ($user->id == $record->user_id || $this->isAdmin($user));  | 
                                                        
| 47 | 47 | });  | 
                                                        
| 48 | 48 | |
| 49 | 49 | // primarily used to set javascript variable.  | 
                                                        
| 50 | -        $gate->define('update_self', function ($user, $page) { | 
                                                        |
| 50 | +        $gate->define('update_self', function($user, $page) { | 
                                                        |
| 51 | 51 | return $user->id == $page->id && !$this->isAdmin($user);  | 
                                                        
| 52 | 52 | });  | 
                                                        
| 53 | 53 | |
| 54 | -        $gate->define('show_user', function ($user, $page) { | 
                                                        |
| 54 | +        $gate->define('show_user', function($user, $page) { | 
                                                        |
| 55 | 55 | return ($this->isViewer($user) || $user->id === $page->id);  | 
                                                        
| 56 | 56 | });  | 
                                                        
| 57 | 57 | |
| 58 | -        $gate->define('show_note', function ($user, $page) { | 
                                                        |
| 58 | +        $gate->define('show_note', function($user, $page) { | 
                                                        |
| 59 | 59 | return ($this->isAdmin($user) || Note::findOrFail($page->id)->user()->id === $user->id);  | 
                                                        
| 60 | 60 | });  | 
                                                        
| 61 | 61 | |
| 62 | -        $gate->define('show_published_news', function ($user, $news) { | 
                                                        |
| 62 | +        $gate->define('show_published_news', function($user, $news) { | 
                                                        |
| 63 | 63 | return ($this->isViewer($user) ||  | 
                                                        
| 64 | 64 | ($news->publish_date <= Carbon::today() &&  | 
                                                        
| 65 | 65 | ($news->expire_date >= Carbon::today() ||  | 
                                                        
@@ -19,7 +19,7 @@  | 
                                                    ||
| 19 | 19 | /*  | 
                                                        
| 20 | 20 | * Authenticate the user's personal channel...  | 
                                                        
| 21 | 21 | */  | 
                                                        
| 22 | -        Broadcast::channel('App.User.*', function ($user, $userId) { | 
                                                        |
| 22 | +        Broadcast::channel('App.User.*', function($user, $userId) { | 
                                                        |
| 23 | 23 | return (int) $user->id === (int) $userId;  | 
                                                        
| 24 | 24 | });  | 
                                                        
| 25 | 25 | }  | 
                                                        
@@ -45,7 +45,7 @@ discard block  | 
                                                    ||
| 45 | 45 | Route::group([  | 
                                                        
| 46 | 46 | 'middleware' => 'web',  | 
                                                        
| 47 | 47 | 'namespace' => $this->namespace,  | 
                                                        
| 48 | -        ], function ($router) { | 
                                                        |
| 48 | +        ], function($router) { | 
                                                        |
| 49 | 49 |              require base_path('routes/web.php'); | 
                                                        
| 50 | 50 | });  | 
                                                        
| 51 | 51 | }  | 
                                                        
@@ -62,7 +62,7 @@ discard block  | 
                                                    ||
| 62 | 62 | 'middleware' => 'api',  | 
                                                        
| 63 | 63 | 'namespace' => $this->namespace,  | 
                                                        
| 64 | 64 | 'prefix' => 'api',  | 
                                                        
| 65 | -        ], function ($router) { | 
                                                        |
| 65 | +        ], function($router) { | 
                                                        |
| 66 | 66 |              require base_path('routes/api.php'); | 
                                                        
| 67 | 67 | });  | 
                                                        
| 68 | 68 | }  | 
                                                        
@@ -16,7 +16,7 @@  | 
                                                    ||
| 16 | 16 | public function boot()  | 
                                                        
| 17 | 17 |      { | 
                                                        
| 18 | 18 | // Pass the logged in user's full name to the layouts._header view.  | 
                                                        
| 19 | -        view()->composer(['layouts._navbar', 'home._last_login'], function ($view) { | 
                                                        |
| 19 | +        view()->composer(['layouts._navbar', 'home._last_login'], function($view) { | 
                                                        |
| 20 | 20 |              $view->with('logged_in_user', Auth::user()->user_full_name); | 
                                                        
| 21 | 21 |              $view->with('duties', Duty::all()); | 
                                                        
| 22 | 22 | });  |