@@ -74,7 +74,7 @@ |
||
74 | 74 | ->editColumn('filename', function ($data) { |
75 | 75 | return '<a href='.env('APP_URL').'/download_file/'.$data->filename.'>'.substr($data->classRoom->name, 0, 10).'</a>'; |
76 | 76 | }) |
77 | - ->editColumn('error', function ($data) { |
|
77 | + ->editColumn('error', function ($data) { |
|
78 | 78 | return '<a href='.env('APP_URL').'/download/'.$data->filename.'>'.substr($data->classRoom->name, 0, 10).'</a>'; |
79 | 79 | })->editColumn('actions', function ($data) { |
80 | 80 |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | |
30 | 30 | } |
31 | 31 | |
32 | - /** |
|
33 | - * @return \Illuminate\Support\Collection |
|
34 | - */ |
|
32 | + /** |
|
33 | + * @return \Illuminate\Support\Collection |
|
34 | + */ |
|
35 | 35 | public function importExportView() |
36 | 36 | { |
37 | 37 | $classes = (!Auth::user()->permissions->isEmpty()) ? Auth::user()->permissions[0]->staff_class : Auth::user()->principal[0]->security_group_institution->institution_classes; |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | |
43 | 43 | |
44 | 44 | /** |
45 | - * @return \Illuminate\Support\Collection |
|
46 | - */ |
|
45 | + * @return \Illuminate\Support\Collection |
|
46 | + */ |
|
47 | 47 | public function export(Request $request) |
48 | 48 | { |
49 | - $request->validate([ |
|
49 | + $request->validate([ |
|
50 | 50 | 'class' => 'required' |
51 | 51 | ]); |
52 | 52 | return Excel::download(new UsersExport($request->input('class')), 'users.xlsx'); |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | |
56 | 56 | |
57 | 57 | /** |
58 | - * @return \Illuminate\Support\Collection |
|
59 | - */ |
|
58 | + * @return \Illuminate\Support\Collection |
|
59 | + */ |
|
60 | 60 | public function import(Request $request) |
61 | 61 | { |
62 | 62 |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | |
101 | 101 | $this->isValidSheet = false; |
102 | 102 | $error = \Illuminate\Validation\ValidationException::withMessages([]); |
103 | - $failure = new Failure(3, 'remark', [0 => 'Template is not valid for upload, use the template given in the system'], [null]); |
|
104 | - $failures = [0 => $failure]; |
|
105 | - throw new \Maatwebsite\Excel\Validators\ValidationException($error, $failures); |
|
103 | + $failure = new Failure(3, 'remark', [0 => 'Template is not valid for upload, use the template given in the system'], [null]); |
|
104 | + $failures = [0 => $failure]; |
|
105 | + throw new \Maatwebsite\Excel\Validators\ValidationException($error, $failures); |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | |
@@ -194,9 +194,9 @@ discard block |
||
194 | 194 | } |
195 | 195 | |
196 | 196 | protected function checkKeys($key,$count,$row){ |
197 | - if(array_key_exists($key,$row)){ |
|
198 | - return true; |
|
199 | - }else{ |
|
197 | + if(array_key_exists($key,$row)){ |
|
198 | + return true; |
|
199 | + }else{ |
|
200 | 200 | $error = \Illuminate\Validation\ValidationException::withMessages([]); |
201 | 201 | $failure = new Failure($count, 'remark', [0 => 'Template is not valid for upload, use the template given in the system'. $key ,' Is missing form the template'], [null]); |
202 | 202 | $failures = [0 => $failure]; |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | */ |
217 | 217 | public function map($row): array { |
218 | 218 | try { |
219 | - $row = $this->mapFields($row); |
|
219 | + $row = $this->mapFields($row); |
|
220 | 220 | } catch (\Maatwebsite\Excel\Validators\ValidationException $e) { |
221 | 221 | $error = \Illuminate\Validation\ValidationException::withMessages([]); |
222 | 222 | $failure = new Failure(3, 'remark', [0 => 'Template is not valid for upload, use the template given in the system'], [null]); |
@@ -18,10 +18,10 @@ |
||
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
21 | - * @param array $row |
|
22 | - * |
|
23 | - * @return \Illuminate\Database\Eloquent\Model|null |
|
24 | - */ |
|
21 | + * @param array $row |
|
22 | + * |
|
23 | + * @return \Illuminate\Database\Eloquent\Model|null |
|
24 | + */ |
|
25 | 25 | |
26 | 26 | public function sheets(): array |
27 | 27 | { |
@@ -25,11 +25,11 @@ |
||
25 | 25 | * |
26 | 26 | * @return void |
27 | 27 | */ |
28 | - public function boot() |
|
29 | - { |
|
30 | - // |
|
31 | - if((\App::environment('dev')) | (\App::environment('stage')) | (\App::environment('prod'))) { |
|
32 | - URL::forceScheme('https'); |
|
33 | - } |
|
34 | - } |
|
28 | + public function boot() |
|
29 | + { |
|
30 | + // |
|
31 | + if((\App::environment('dev')) | (\App::environment('stage')) | (\App::environment('prod'))) { |
|
32 | + URL::forceScheme('https'); |
|
33 | + } |
|
34 | + } |
|
35 | 35 | } |
@@ -135,13 +135,13 @@ |
||
135 | 135 | } |
136 | 136 | protected function validateNic($attribute, $value, $perameters, $validator){ |
137 | 137 | $valid = preg_match('/^([0-9]{9}[VX]|[0-9]{12})$/i', $value); |
138 | - if(!$valid){ |
|
139 | - $this->_custom_messages['nic'] = $attribute. ' is not valid, Please check the NIC number'; |
|
140 | - $this->_set_custom_stuff(); |
|
141 | - return false; |
|
142 | - }else{ |
|
143 | - return true; |
|
144 | - } |
|
138 | + if(!$valid){ |
|
139 | + $this->_custom_messages['nic'] = $attribute. ' is not valid, Please check the NIC number'; |
|
140 | + $this->_set_custom_stuff(); |
|
141 | + return false; |
|
142 | + }else{ |
|
143 | + return true; |
|
144 | + } |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | protected function validateUserUnique($attribute, $value, $perameters, $validator) { |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | public function boot() { |
13 | 13 | $this->app->validator->resolver( function( $translator, $data, $rules, |
14 | - $messages = array(), $customAttributes = array() ) { |
|
14 | + $messages = array(), $customAttributes = array() ) { |
|
15 | 15 | return new ValidatorExtended( $translator, $data, $rules, $messages, |
16 | 16 | $customAttributes ); |
17 | 17 | } ); |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | protected function mapWebRoutes() |
53 | 53 | { |
54 | 54 | Route::middleware('web') |
55 | - ->namespace($this->namespace) |
|
56 | - ->group(base_path('routes/web.php')); |
|
55 | + ->namespace($this->namespace) |
|
56 | + ->group(base_path('routes/web.php')); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | protected function mapApiRoutes() |
67 | 67 | { |
68 | 68 | Route::prefix('api') |
69 | - ->middleware('api') |
|
70 | - ->namespace($this->namespace) |
|
71 | - ->group(base_path('routes/api.php')); |
|
69 | + ->middleware('api') |
|
70 | + ->namespace($this->namespace) |
|
71 | + ->group(base_path('routes/api.php')); |
|
72 | 72 | } |
73 | 73 | } |
@@ -212,7 +212,7 @@ |
||
212 | 212 | 'created_user_id' => $student['created_user_id'] |
213 | 213 | ]; |
214 | 214 | try{ |
215 | - Institution_student::where('id',(string)$student['id'])->update($studentData); |
|
215 | + Institution_student::where('id',(string)$student['id'])->update($studentData); |
|
216 | 216 | $output = new \Symfony\Component\Console\Output\ConsoleOutput(); |
217 | 217 | $output->writeln('----------------- '. $student['admission_id'] . ' to ' . $studentData['education_grade_id']); |
218 | 218 |