- Timestamp:
- 11/23/21 22:01:52 (3 years ago)
- Branches:
- master
- Children:
- dbc5976
- Parents:
- 4d73966
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Http/Controllers/Dashboard/DepartmentsController.php
r4d73966 r0a1fb54 27 27 } 28 28 29 public function create()30 {31 return view("dashboard.departments.create");32 }33 34 29 public function store(NewDepartmentRequest $request) 35 30 { … … 48 43 $department->user_id = auth()->id(); 49 44 50 $users = User::all();51 52 45 $department->save(); 53 46 … … 55 48 56 49 return redirect()->route("dashboard.departments.index"); 57 }58 59 public function editShow($id)60 {61 return view("dashboard.departments.edit")->with([62 "department" => Department::findOrFail($id)63 ]);64 50 } 65 51 … … 79 65 $location = 'Departments' . DIRECTORY_SEPARATOR . $request->code; 80 66 81 if(!Storage::disk('local')->has($location) && Folder::where('department_id', $department->id)->pluck('no_of_files')->first() > 0){67 if(!Storage::disk('local')->has($location) ){ 82 68 Storage::disk('local')->move($oldLocation, $location); 83 69 $department->location = $location; … … 88 74 $folder->arch_id = $department->code . '/' . $currArchId; 89 75 $folder->save(); 76 90 77 foreach($folder->files as $file) { 78 //dd($file); 91 79 $file->location = $location . DIRECTORY_SEPARATOR . $folder->name . DIRECTORY_SEPARATOR . $file->name; 92 80 $file->save();
Note:
See TracChangeset
for help on using the changeset viewer.