- Timestamp:
- 10/15/21 00:21:44 (3 years ago)
- Branches:
- develop, master
- Children:
- d795fa6
- Parents:
- 24a616f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Http/Controllers/Dashboard/DepartmentsController.php
r24a616f r120759b 34 34 } 35 35 36 public function store(NewDepartmentRequest $request) 37 { 38 $department = new Department(); 39 40 $department->name = $request->name; 41 $department->code = $request->code; 42 43 if(!Storage::disk('local')->has('Departments/' . $request->code)){ 44 Storage::disk('local')->makeDirectory('Departments/' . $request->code); 45 } 46 47 $department->user_id = auth()->id(); 48 $department->location = '/Departments/' . $request->code; 49 50 $department->save(); 51 52 Alert::flash("New Department added successfully"); 53 54 return redirect()->route("dashboard.departments.index"); 55 } 56 36 57 public function edit(UpdateDepartmentRequest $request, $id) 37 58 { … … 62 83 } 63 84 64 public function store(NewDepartmentRequest $request)65 {66 $department = new Department();67 68 $department->name = $request->name;69 $department->code = $request->code;70 71 if(!Storage::disk('local')->has('Departments/' . $request->code)){72 Storage::disk('local')->makeDirectory('Departments/' . $request->code);73 }74 75 $department->user_id = auth()->id();76 $department->location = '/Departments/' . $request->code;77 78 dd($department->location);79 80 $department->save();81 82 Alert::flash("New Department added successfully");83 84 return redirect()->route("dashboard.departments.index");85 }86 87 85 public function destroy(Request $request, $id) 88 86 {
Note:
See TracChangeset
for help on using the changeset viewer.