Changeset 28bab7b for app/Http


Ignore:
Timestamp:
11/03/21 12:39:35 (3 years ago)
Author:
beratkjufliju <kufliju@…>
Branches:
master
Children:
e3af09e
Parents:
3536fe9
Message:

added create version

Location:
app/Http/Controllers/Dashboard
Files:
2 edited

Legend:

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

    r3536fe9 r28bab7b  
    163163
    164164            else {
    165             Alert::flash("All departments are empty", "warning");
     165            Alert::flash("All folders are empty", "warning");
    166166            return redirect()->back();
    167167            }
  • app/Http/Controllers/Dashboard/FoldersController.php

    r3536fe9 r28bab7b  
    119119        $existingFolder = Folder::where(['department_id' => $request->department, 'name' => $request->name, 'arch_id' => $request->arch_id])->count();
    120120
    121         $existingFolderName = Folder::where(['department_id' => $request->department, 'name' => $request->name])->count();
    122         $existingFolderArchId = Folder::where(['department_id' => $request->department, 'arch_id' => $request->arch_id])->count();
     121        $existingFolderName = Folder::where(['department_id' => $request->department, 'name' => $request->name])->get();
     122        $existingFolderArchId = Folder::where(['department_id' => $request->department, 'arch_id' => $request->arch_id])->get();
    123123
    124124        if($existingFolder > 0) {
     
    126126        }
    127127
    128         if(($existingFolderName > 0 && $existingFolderArchId <= 0) || ($existingFolderName <= 0 && $existingFolderArchId > 0)) {
     128        //dd($existingFolderName, $existingFolderArchId);
     129
     130        if(($existingFolderName->isNotEmpty() && $existingFolderArchId->isEmpty()) || ($existingFolderName->isEmpty() && $existingFolderArchId->isNotEmpty())) {
    129131            Alert::flash("Can't create another version since folder name or archive ID is different", "error");
    130132
Note: See TracChangeset for help on using the changeset viewer.