Changeset 796e7ac
- Timestamp:
- 10/25/21 13:59:16 (3 years ago)
- Branches:
- develop, master
- Children:
- 05e57e2
- Parents:
- ff5b46e
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Http/Controllers/Dashboard/DepartmentsController.php
rff5b46e r796e7ac 127 127 $folders = Folder::where('department_id', $department->id)->get(); 128 128 } 129 if($folders->where('no_of_files' > 0)->count()) { 130 $flag = true; 129 foreach ($folders as $folder){ 130 if($folder->no_of_files > 0){ 131 $flag=true; 131 132 break; 133 } 132 134 } 133 135 } … … 159 161 160 162 else { 161 Alert::flash("All departments are empty", "warning"); 162 return redirect()->back(); 163 } 163 Alert::flash("All departments are empty", "warning"); 164 return redirect()->back(); 165 } 166 164 167 } 165 168 … … 170 173 $flag = false; 171 174 172 if($folders->where('no_of_files' > 0)->count()){ 173 $flag = true; 174 } 175 foreach($folders as $folder){ 176 if($folder->no_of_files > 0) 177 $flag=true; 178 break; 179 } 175 180 176 181 if($flag) { -
database/factories/FolderFactory.php
rff5b46e r796e7ac 27 27 public function definition() 28 28 { 29 $inputArray = [5, 15, 25, 35, 45, 55, 65, 75];30 $deptId = Arr::random($inputArray);29 //$inputArray = [5, 15, 25, 35, 45, 55, 65, 75]; 30 //$deptId = Arr::random($inputArray); 31 31 32 //$deptId = $this->faker->numberBetween(1, 10);32 $deptId = $this->faker->numberBetween(1, 10); 33 33 34 34 $deptCode = Department::find($deptId)->code;
Note:
See TracChangeset
for help on using the changeset viewer.