Ignore:
Timestamp:
11/23/21 22:01:52 (3 years ago)
Author:
beratkjufliju <kufliju@…>
Branches:
master
Children:
dbc5976
Parents:
4d73966
Message:

bug fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • app/Http/Controllers/Dashboard/DepartmentsController.php

    r4d73966 r0a1fb54  
    2727    }
    2828
    29     public function create()
    30     {
    31         return view("dashboard.departments.create");
    32     }
    33 
    3429    public function store(NewDepartmentRequest $request)
    3530    {
     
    4843        $department->user_id = auth()->id();
    4944
    50         $users = User::all();
    51 
    5245        $department->save();
    5346
     
    5548
    5649        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         ]);
    6450    }
    6551
     
    7965            $location = 'Departments' . DIRECTORY_SEPARATOR . $request->code;
    8066
    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) ){
    8268                Storage::disk('local')->move($oldLocation, $location);
    8369                $department->location = $location;
     
    8874                    $folder->arch_id = $department->code . '/' . $currArchId;
    8975                    $folder->save();
     76
    9077                foreach($folder->files as $file) {
     78                    //dd($file);
    9179                    $file->location = $location . DIRECTORY_SEPARATOR . $folder->name . DIRECTORY_SEPARATOR . $file->name;
    9280                    $file->save();
Note: See TracChangeset for help on using the changeset viewer.