Changeset b9c4a92
- Timestamp:
- 10/18/21 23:00:23 (3 years ago)
- Branches:
- develop, master
- Children:
- ea7b12a
- Parents:
- e6c1f87
- Files:
-
- 5 added
- 1 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Http/Controllers/Dashboard/DepartmentsController.php
re6c1f87 rb9c4a92 14 14 use Illuminate\Support\Facades\Auth; 15 15 use Illuminate\Support\Facades\Storage; 16 use function Illuminate\Events\queueable; 16 17 17 18 class DepartmentsController extends Controller … … 36 37 $department->code = $request->code; 37 38 38 $l en = Storage::disk('local')->path('');39 $location = 'Departments' . DIRECTORY_SEPARATOR . $request->code; 39 40 40 if(!Storage::disk('local')->has('Departments/' . $request->code)){ 41 Storage::disk('local')->makeDirectory('Departments/' . $request->code); 41 if(!Storage::disk('local')->has($location)){ 42 Storage::disk('local')->makeDirectory($location); 43 42 44 } 43 45 $department->location = Storage::disk('local')->path('') . $location; 44 46 $department->user_id = auth()->id(); 45 $department->location = Storage::disk('local')->path('') . 'Departments/' . $request->code;46 47 47 48 $department->save(); … … 63 64 $department = Department::findOrFail($id); 64 65 65 $old DepartmentCode =$department->code;66 $oldLocation = DIRECTORY_SEPARATOR . 'Departments' . DIRECTORY_SEPARATOR . $department->code; 66 67 67 68 $department->name = $request->name; 68 69 $department->code = $request->code; 69 70 70 $department->location = Storage::disk('local')->path('') . 'Departments/' . $request->code;71 72 $files = Storage::allFiles($oldDepartmentCode);73 74 71 if($department->isDirty('code')) 75 72 { 76 if(!Storage::disk('local')->has('Departments/' . $request->code)){ 77 Storage::disk('local')->move('Departments/' . $oldDepartmentCode, 'Departments/' . $department->code); 73 $location = 'Departments' . DIRECTORY_SEPARATOR . $request->code; 74 if(!Storage::disk('local')->has($location)){ 75 Storage::disk('local')->move($oldLocation, $location); 76 $department->location = Storage::disk('local')->path('') . $location; 78 77 } 79 78 } -
app/Http/Controllers/Dashboard/DocumentsController.php
re6c1f87 rb9c4a92 26 26 $result = $result->flatten(); 27 27 28 $deptName = ""; 29 $deptCode = ""; 28 30 29 31 if ($request->query('id')) { 30 31 $documentsInDeptSort = Document::with('department')->when($request->has('id'), function($query) use ($request) { 32 $deptName = Department::find($request->query('id'))->getOriginal('name'); 33 $deptCode = Department::find($request->query('id'))->getOriginal('code'); 34 $documentsInDeptSort = Document::with('department')->when($request->has('id'), function ($query) use ($request) { 32 35 $query->where('department_id', $request->query('id')); 33 36 }); 34 37 35 if($request->query('sort') == 'newest') { 36 $documents = $documentsInDeptSort->orderBy('created_at', 'desc')->paginate(20); 37 } 38 else if($request->query('sort') == 'name') { 39 $documents = $documentsInDeptSort->orderBy('name', 'asc')->paginate(20); 40 } 41 else{ 42 $documents = Document::where('department_id', $request->query('id'))->paginate(20); 43 } 44 } 45 else { 46 if($request->query('sort') == 'newest') { 47 $documents = Document::orderBy('created_at', 'desc')->paginate(20); 48 } 49 else if($request->query('sort') == 'name') { 50 $documents = Document::orderBy('name', 'asc')->paginate(20); 51 } 52 else if($request->query('sort') == 'important'){ 53 $documents = Document::where('is_important', true)->paginate(20); 54 } 55 else if($request->query('sort') == 'recent') { 56 $documents = Document::orderBy('created_at', 'desc')->paginate(20); 57 } 58 else if($request->query('search')){ 38 if ($request->query('sort') == 'newest') { 39 $documents = $documentsInDeptSort->orderBy('created_at', 'desc')->paginate(16); 40 } else if ($request->query('sort') == 'name') { 41 $documents = $documentsInDeptSort->orderBy('name', 'asc')->paginate(16); 42 } else { 43 $documents = Document::where('department_id', $request->query('id'))->paginate(16); 44 } 45 } else { 46 if ($request->query('sort') == 'newest') { 47 $documents = Document::orderBy('created_at', 'desc')->paginate(16); 48 } else if ($request->query('sort') == 'name') { 49 $documents = Document::orderBy('name', 'asc')->paginate(16); 50 } else if ($request->query('sort') == 'important') { 51 $documents = Document::where('is_important', true)->paginate(16); 52 } else if ($request->query('sort') == 'recent') { 53 $documents = Document::orderBy('created_at', 'desc')->paginate(16); 54 } else if ($request->query('search')) { 59 55 $result = collect(); 60 56 … … 64 60 $result = $result->flatten(); 65 61 $documents = $result; 66 } 67 else 68 { 62 } else { 69 63 $documents = Document::paginate(20); 70 64 } … … 76 70 $diskTotalSize = $diskTotal / 1073741824; 77 71 78 $diskFree 72 $diskFree = disk_free_space('/'); 79 73 $used = $diskTotal - $diskFree; 80 74 … … 93 87 "diskTotalSize" => $diskTotalSize, 94 88 "diskUse" => $diskUse, 95 "diskUsedSize" => $diskUsedSize 89 "diskUsedSize" => $diskUsedSize, 90 "deptName" => $deptName, 91 "deptCode" => $deptCode, 96 92 97 93 ]); … … 106 102 } 107 103 108 public function store(DocumentRequest $request , UploadService $uploadService)104 public function store(DocumentRequest $request) 109 105 { 110 106 $document = new Document(); … … 119 115 $document->description = $request->description; 120 116 121 if (!Storage::disk('local')->has($document->department()->pluck('location')->join("") . '/' . $request->arch_id)) { 122 Storage::disk('local')->makeDirectory($document->department()->pluck('location')->join("") . '/' . $request->arch_id); 123 } 124 125 $documentFile = $uploadService->upload(File::class, [ 126 "file_item" => $request->file_item, 127 ], "link", true); 117 $location = DIRECTORY_SEPARATOR . 'Departments' . DIRECTORY_SEPARATOR . $document->department->name . DIRECTORY_SEPARATOR . $request->name; 118 119 if (!Storage::disk('local')->has($location)) { 120 Storage::disk('local')->makeDirectory($location); 121 } 122 123 foreach ($request->file_item as $file) { 124 $file->storeAs($location . DIRECTORY_SEPARATOR, $file->getClientOriginalName()); 125 $newFile = new File(); 126 $newFile->link = $location . DIRECTORY_SEPARATOR . $file->getClientOriginalName(); 127 $newFile->document()->associate($document); 128 $newFile->save(); 129 } 128 130 129 131 $document->save(); 130 132 131 foreach ($documentFile as $df) {132 $file = File::find($df);133 $file->document()->associate($document);134 $file->save();135 }136 137 133 Alert::flash("New document created successfully"); 138 134 … … 142 138 public function editShow($id) 143 139 { 144 // if (!auth()->user()->hasPermission("edit_all_documents")) {145 // return redirect()->route("dashboard.documents.index");146 // }147 148 140 return view("dashboard.documents.edit")->with([ 149 141 "document" => Document::findOrFail($id), … … 164 156 $document->description = $request->description; 165 157 158 $oldLocation = DIRECTORY_SEPARATOR . 'Departments' . DIRECTORY_SEPARATOR . $document->department->name . DIRECTORY_SEPARATOR . $document->name; 159 $location = DIRECTORY_SEPARATOR . 'Departments' . DIRECTORY_SEPARATOR . $document->department->name . DIRECTORY_SEPARATOR . $request->name; 160 161 if ($document->isDirty('name')) { 162 if (!Storage::disk('local')->has($location)) { 163 Storage::disk('local')->move($oldLocation, $location); 164 } 165 } 166 167 $hasFileError = false; 168 if ($request->has('file_item')) { 169 foreach ($request->file_item as $file) { 170 $fileName = $file->getClientOriginalName(); 171 if(Storage::disk('local')->has($location . DIRECTORY_SEPARATOR . $fileName)) { 172 $hasFileError = true; 173 break; 174 } 175 $file->storeAs($location . DIRECTORY_SEPARATOR, $fileName); 176 $newFile = new File(); 177 $newFile->link = $location . DIRECTORY_SEPARATOR . $fileName; 178 $newFile->document()->associate($document); 179 $newFile->save(); 180 } 181 } 182 183 if($hasFileError) { 184 Alert::flash('Document with the same name exists', 'error'); 185 return redirect()->route("dashboard.documents.edit", ['id' => $document->id]); 186 } 187 166 188 $document->save(); 167 189 … … 177 199 $document->save(); 178 200 179 if ($document->is_important==true)180 Alert::flash("Document marked as important successfully");201 if ($document->is_important == true) 202 Alert::flash("Document marked as important successfully"); 181 203 else 182 204 Alert::flash("Document marked as not important successfully"); … … 208 230 { 209 231 $document = Document::find($id); 210 if (auth()->user()->hasPermission("delete_all_ posts")) {232 if (auth()->user()->hasPermission("delete_all_documents")) { 211 233 $document->delete(); 212 234 Alert::flash($document->name . " deleted successfully"); -
app/Http/Requests/Dashboard/DocumentRequest.php
re6c1f87 rb9c4a92 36 36 "arch_id" => [ 37 37 "required", 38 function ($attribute, $value, $fail) {38 function ($attribute, $value, $fail) { 39 39 $arch_id = $this->request->get('arch_id'); 40 40 $deptId = explode('/', $arch_id)[0]; 41 $archNum = explode('/', $arch_id)[1]; 42 43 if (empty($archNum)) { 44 $fail("Please enter documents Archive ID"); 45 } 46 41 47 if ($deptId !== Department::find($this->request->get('department'))->code) { 42 48 $fail("Document Archive ID field format is invalid"); -
app/Services/UploadService.php
re6c1f87 rb9c4a92 11 11 public function upload($object, $names, $fieldName = null, $isMultiple = false) 12 12 { 13 dd($object); 13 14 $objIds = []; 14 15 -
composer.lock
re6c1f87 rb9c4a92 581 581 { 582 582 "name": "graham-campbell/result-type", 583 "version": "v1.0. 2",583 "version": "v1.0.3", 584 584 "source": { 585 585 "type": "git", 586 586 "url": "https://github.com/GrahamCampbell/Result-Type.git", 587 "reference": " 84afea85c6841deeea872f36249a206e878a5de0"588 }, 589 "dist": { 590 "type": "zip", 591 "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/ 84afea85c6841deeea872f36249a206e878a5de0",592 "reference": " 84afea85c6841deeea872f36249a206e878a5de0",587 "reference": "296c015dc30ec4322168c5ad3ee5cc11dae827ac" 588 }, 589 "dist": { 590 "type": "zip", 591 "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/296c015dc30ec4322168c5ad3ee5cc11dae827ac", 592 "reference": "296c015dc30ec4322168c5ad3ee5cc11dae827ac", 593 593 "shasum": "" 594 594 }, … … 626 626 "support": { 627 627 "issues": "https://github.com/GrahamCampbell/Result-Type/issues", 628 "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0. 2"628 "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.3" 629 629 }, 630 630 "funding": [ … … 638 638 } 639 639 ], 640 "time": "2021- 08-28T21:34:50+00:00"640 "time": "2021-10-17T19:48:54+00:00" 641 641 }, 642 642 { 643 643 "name": "guzzlehttp/guzzle", 644 "version": "7. 3.0",644 "version": "7.4.0", 645 645 "source": { 646 646 "type": "git", 647 647 "url": "https://github.com/guzzle/guzzle.git", 648 "reference": " 7008573787b430c1c1f650e3722d9bba59967628"649 }, 650 "dist": { 651 "type": "zip", 652 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ 7008573787b430c1c1f650e3722d9bba59967628",653 "reference": " 7008573787b430c1c1f650e3722d9bba59967628",648 "reference": "868b3571a039f0ebc11ac8f344f4080babe2cb94" 649 }, 650 "dist": { 651 "type": "zip", 652 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/868b3571a039f0ebc11ac8f344f4080babe2cb94", 653 "reference": "868b3571a039f0ebc11ac8f344f4080babe2cb94", 654 654 "shasum": "" 655 655 }, 656 656 "require": { 657 657 "ext-json": "*", 658 "guzzlehttp/promises": "^1. 4",659 "guzzlehttp/psr7": "^1. 7 || ^2.0",658 "guzzlehttp/promises": "^1.5", 659 "guzzlehttp/psr7": "^1.8.3 || ^2.1", 660 660 "php": "^7.2.5 || ^8.0", 661 "psr/http-client": "^1.0" 661 "psr/http-client": "^1.0", 662 "symfony/deprecation-contracts": "^2.2" 662 663 }, 663 664 "provide": { … … 669 670 "php-http/client-integration-tests": "^3.0", 670 671 "phpunit/phpunit": "^8.5.5 || ^9.3.5", 671 "psr/log": "^1.1 "672 "psr/log": "^1.1 || ^2.0 || ^3.0" 672 673 }, 673 674 "suggest": { … … 679 680 "extra": { 680 681 "branch-alias": { 681 "dev-master": "7. 3-dev"682 "dev-master": "7.4-dev" 682 683 } 683 684 }, … … 696 697 "authors": [ 697 698 { 699 "name": "Graham Campbell", 700 "email": "hello@gjcampbell.co.uk", 701 "homepage": "https://github.com/GrahamCampbell" 702 }, 703 { 698 704 "name": "Michael Dowling", 699 705 "email": "mtdowling@gmail.com", … … 701 707 }, 702 708 { 709 "name": "Jeremy Lindblom", 710 "email": "jeremeamia@gmail.com", 711 "homepage": "https://github.com/jeremeamia" 712 }, 713 { 714 "name": "George Mponos", 715 "email": "gmponos@gmail.com", 716 "homepage": "https://github.com/gmponos" 717 }, 718 { 719 "name": "Tobias Nyholm", 720 "email": "tobias.nyholm@gmail.com", 721 "homepage": "https://github.com/Nyholm" 722 }, 723 { 703 724 "name": "Márk Sági-Kazár", 704 725 "email": "mark.sagikazar@gmail.com", 705 "homepage": "https://sagikazarmark.hu" 726 "homepage": "https://github.com/sagikazarmark" 727 }, 728 { 729 "name": "Tobias Schultze", 730 "email": "webmaster@tubo-world.de", 731 "homepage": "https://github.com/Tobion" 706 732 } 707 733 ], 708 734 "description": "Guzzle is a PHP HTTP client library", 709 "homepage": "http://guzzlephp.org/",710 735 "keywords": [ 711 736 "client", … … 721 746 "support": { 722 747 "issues": "https://github.com/guzzle/guzzle/issues", 723 "source": "https://github.com/guzzle/guzzle/tree/7. 3.0"748 "source": "https://github.com/guzzle/guzzle/tree/7.4.0" 724 749 }, 725 750 "funding": [ … … 733 758 }, 734 759 { 735 "url": "https://github.com/alexeyshockov", 736 "type": "github" 737 }, 738 { 739 "url": "https://github.com/gmponos", 740 "type": "github" 741 } 742 ], 743 "time": "2021-03-23T11:33:13+00:00" 760 "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", 761 "type": "tidelift" 762 } 763 ], 764 "time": "2021-10-18T09:52:00+00:00" 744 765 }, 745 766 { 746 767 "name": "guzzlehttp/promises", 747 "version": "1. 4.1",768 "version": "1.5.0", 748 769 "source": { 749 770 "type": "git", 750 771 "url": "https://github.com/guzzle/promises.git", 751 "reference": " 8e7d04f1f6450fef59366c399cfad4b9383aa30d"752 }, 753 "dist": { 754 "type": "zip", 755 "url": "https://api.github.com/repos/guzzle/promises/zipball/ 8e7d04f1f6450fef59366c399cfad4b9383aa30d",756 "reference": " 8e7d04f1f6450fef59366c399cfad4b9383aa30d",772 "reference": "136a635e2b4a49b9d79e9c8fee267ffb257fdba0" 773 }, 774 "dist": { 775 "type": "zip", 776 "url": "https://api.github.com/repos/guzzle/promises/zipball/136a635e2b4a49b9d79e9c8fee267ffb257fdba0", 777 "reference": "136a635e2b4a49b9d79e9c8fee267ffb257fdba0", 757 778 "shasum": "" 758 779 }, … … 766 787 "extra": { 767 788 "branch-alias": { 768 "dev-master": "1. 4-dev"789 "dev-master": "1.5-dev" 769 790 } 770 791 }, … … 783 804 "authors": [ 784 805 { 806 "name": "Graham Campbell", 807 "email": "hello@gjcampbell.co.uk", 808 "homepage": "https://github.com/GrahamCampbell" 809 }, 810 { 785 811 "name": "Michael Dowling", 786 812 "email": "mtdowling@gmail.com", 787 813 "homepage": "https://github.com/mtdowling" 814 }, 815 { 816 "name": "Tobias Nyholm", 817 "email": "tobias.nyholm@gmail.com", 818 "homepage": "https://github.com/Nyholm" 819 }, 820 { 821 "name": "Tobias Schultze", 822 "email": "webmaster@tubo-world.de", 823 "homepage": "https://github.com/Tobion" 788 824 } 789 825 ], … … 794 830 "support": { 795 831 "issues": "https://github.com/guzzle/promises/issues", 796 "source": "https://github.com/guzzle/promises/tree/1.4.1" 797 }, 798 "time": "2021-03-07T09:25:29+00:00" 832 "source": "https://github.com/guzzle/promises/tree/1.5.0" 833 }, 834 "funding": [ 835 { 836 "url": "https://github.com/GrahamCampbell", 837 "type": "github" 838 }, 839 { 840 "url": "https://github.com/Nyholm", 841 "type": "github" 842 }, 843 { 844 "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", 845 "type": "tidelift" 846 } 847 ], 848 "time": "2021-10-07T13:05:22+00:00" 799 849 }, 800 850 { 801 851 "name": "guzzlehttp/psr7", 802 "version": "2. 0.0",852 "version": "2.1.0", 803 853 "source": { 804 854 "type": "git", 805 855 "url": "https://github.com/guzzle/psr7.git", 806 "reference": " 1dc8d9cba3897165e16d12bb13d813afb1eb3fe7"807 }, 808 "dist": { 809 "type": "zip", 810 "url": "https://api.github.com/repos/guzzle/psr7/zipball/ 1dc8d9cba3897165e16d12bb13d813afb1eb3fe7",811 "reference": " 1dc8d9cba3897165e16d12bb13d813afb1eb3fe7",856 "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72" 857 }, 858 "dist": { 859 "type": "zip", 860 "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72", 861 "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72", 812 862 "shasum": "" 813 863 }, … … 833 883 "extra": { 834 884 "branch-alias": { 835 "dev-master": "2. 0-dev"885 "dev-master": "2.1-dev" 836 886 } 837 887 }, … … 846 896 ], 847 897 "authors": [ 898 { 899 "name": "Graham Campbell", 900 "email": "hello@gjcampbell.co.uk", 901 "homepage": "https://github.com/GrahamCampbell" 902 }, 848 903 { 849 904 "name": "Michael Dowling", … … 852 907 }, 853 908 { 909 "name": "George Mponos", 910 "email": "gmponos@gmail.com", 911 "homepage": "https://github.com/gmponos" 912 }, 913 { 914 "name": "Tobias Nyholm", 915 "email": "tobias.nyholm@gmail.com", 916 "homepage": "https://github.com/Nyholm" 917 }, 918 { 919 "name": "Márk Sági-Kazár", 920 "email": "mark.sagikazar@gmail.com", 921 "homepage": "https://github.com/sagikazarmark" 922 }, 923 { 854 924 "name": "Tobias Schultze", 925 "email": "webmaster@tubo-world.de", 855 926 "homepage": "https://github.com/Tobion" 856 927 }, … … 874 945 "support": { 875 946 "issues": "https://github.com/guzzle/psr7/issues", 876 "source": "https://github.com/guzzle/psr7/tree/2.0.0" 877 }, 878 "time": "2021-06-30T20:03:07+00:00" 947 "source": "https://github.com/guzzle/psr7/tree/2.1.0" 948 }, 949 "funding": [ 950 { 951 "url": "https://github.com/GrahamCampbell", 952 "type": "github" 953 }, 954 { 955 "url": "https://github.com/Nyholm", 956 "type": "github" 957 }, 958 { 959 "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", 960 "type": "tidelift" 961 } 962 ], 963 "time": "2021-10-06T17:43:30+00:00" 879 964 }, 880 965 { 881 966 "name": "laravel/framework", 882 "version": "v8.6 2.0",967 "version": "v8.64.0", 883 968 "source": { 884 969 "type": "git", 885 970 "url": "https://github.com/laravel/framework.git", 886 "reference": " 60a7e00488167ce2babf3a2aeb3677e48aaf39be"887 }, 888 "dist": { 889 "type": "zip", 890 "url": "https://api.github.com/repos/laravel/framework/zipball/ 60a7e00488167ce2babf3a2aeb3677e48aaf39be",891 "reference": " 60a7e00488167ce2babf3a2aeb3677e48aaf39be",971 "reference": "3337c029e1bb31d9712d27437cc27010ba302c9e" 972 }, 973 "dist": { 974 "type": "zip", 975 "url": "https://api.github.com/repos/laravel/framework/zipball/3337c029e1bb31d9712d27437cc27010ba302c9e", 976 "reference": "3337c029e1bb31d9712d27437cc27010ba302c9e", 892 977 "shasum": "" 893 978 }, … … 1047 1132 "source": "https://github.com/laravel/framework" 1048 1133 }, 1049 "time": "2021- 09-28T13:30:25+00:00"1134 "time": "2021-10-12T13:43:13+00:00" 1050 1135 }, 1051 1136 { 1052 1137 "name": "laravel/sanctum", 1053 "version": "v2.11. 2",1138 "version": "v2.11.4", 1054 1139 "source": { 1055 1140 "type": "git", 1056 1141 "url": "https://github.com/laravel/sanctum.git", 1057 "reference": " b21e65cbe13896946986cb0868180cd69e1bd5d3"1058 }, 1059 "dist": { 1060 "type": "zip", 1061 "url": "https://api.github.com/repos/laravel/sanctum/zipball/ b21e65cbe13896946986cb0868180cd69e1bd5d3",1062 "reference": " b21e65cbe13896946986cb0868180cd69e1bd5d3",1142 "reference": "2cc0c0f79eb92578f606f6130fafd31b18229db1" 1143 }, 1144 "dist": { 1145 "type": "zip", 1146 "url": "https://api.github.com/repos/laravel/sanctum/zipball/2cc0c0f79eb92578f606f6130fafd31b18229db1", 1147 "reference": "2cc0c0f79eb92578f606f6130fafd31b18229db1", 1063 1148 "shasum": "" 1064 1149 }, … … 1111 1196 "source": "https://github.com/laravel/sanctum" 1112 1197 }, 1113 "time": "2021- 06-15T15:56:21+00:00"1198 "time": "2021-10-13T13:38:15+00:00" 1114 1199 }, 1115 1200 { 1116 1201 "name": "laravel/serializable-closure", 1117 "version": "v1.0. 2",1202 "version": "v1.0.3", 1118 1203 "source": { 1119 1204 "type": "git", 1120 1205 "url": "https://github.com/laravel/serializable-closure.git", 1121 "reference": "6 79e24d36ff8b9be0e36f5222244ec8602e18867"1122 }, 1123 "dist": { 1124 "type": "zip", 1125 "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/6 79e24d36ff8b9be0e36f5222244ec8602e18867",1126 "reference": "6 79e24d36ff8b9be0e36f5222244ec8602e18867",1206 "reference": "6cfc678735f22ccedad761b8cae2bab14c3d8e5b" 1207 }, 1208 "dist": { 1209 "type": "zip", 1210 "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/6cfc678735f22ccedad761b8cae2bab14c3d8e5b", 1211 "reference": "6cfc678735f22ccedad761b8cae2bab14c3d8e5b", 1127 1212 "shasum": "" 1128 1213 }, … … 1170 1255 "source": "https://github.com/laravel/serializable-closure" 1171 1256 }, 1172 "time": "2021- 09-29T13:25:52+00:00"1257 "time": "2021-10-07T14:00:57+00:00" 1173 1258 }, 1174 1259 { … … 1585 1670 { 1586 1671 "name": "monolog/monolog", 1587 "version": "2.3. 4",1672 "version": "2.3.5", 1588 1673 "source": { 1589 1674 "type": "git", 1590 1675 "url": "https://github.com/Seldaek/monolog.git", 1591 "reference": " 437e7a1c50044b92773b361af77620efb76fff59"1592 }, 1593 "dist": { 1594 "type": "zip", 1595 "url": "https://api.github.com/repos/Seldaek/monolog/zipball/ 437e7a1c50044b92773b361af77620efb76fff59",1596 "reference": " 437e7a1c50044b92773b361af77620efb76fff59",1676 "reference": "fd4380d6fc37626e2f799f29d91195040137eba9" 1677 }, 1678 "dist": { 1679 "type": "zip", 1680 "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd4380d6fc37626e2f799f29d91195040137eba9", 1681 "reference": "fd4380d6fc37626e2f799f29d91195040137eba9", 1597 1682 "shasum": "" 1598 1683 }, … … 1610 1695 "graylog2/gelf-php": "^1.4.2", 1611 1696 "mongodb/mongodb": "^1.8", 1612 "php-amqplib/php-amqplib": "~2.4 ",1697 "php-amqplib/php-amqplib": "~2.4 || ^3", 1613 1698 "php-console/php-console": "^3.1.3", 1614 1699 "phpspec/prophecy": "^1.6.1", … … 1668 1753 "support": { 1669 1754 "issues": "https://github.com/Seldaek/monolog/issues", 1670 "source": "https://github.com/Seldaek/monolog/tree/2.3. 4"1755 "source": "https://github.com/Seldaek/monolog/tree/2.3.5" 1671 1756 }, 1672 1757 "funding": [ … … 1680 1765 } 1681 1766 ], 1682 "time": "2021- 09-15T11:27:21+00:00"1767 "time": "2021-10-01T21:08:31+00:00" 1683 1768 }, 1684 1769 { … … 1778 1863 { 1779 1864 "name": "nette/schema", 1780 "version": "v1.2. 1",1865 "version": "v1.2.2", 1781 1866 "source": { 1782 1867 "type": "git", 1783 1868 "url": "https://github.com/nette/schema.git", 1784 "reference": " f5ed39fc96358f922cedfd1e516f0dadf5d2be0d"1785 }, 1786 "dist": { 1787 "type": "zip", 1788 "url": "https://api.github.com/repos/nette/schema/zipball/ f5ed39fc96358f922cedfd1e516f0dadf5d2be0d",1789 "reference": " f5ed39fc96358f922cedfd1e516f0dadf5d2be0d",1790 "shasum": "" 1791 }, 1792 "require": { 1793 "nette/utils": "^ 3.1.4 ||^4.0",1794 "php": ">=7.1 <8. 1"1869 "reference": "9a39cef03a5b34c7de64f551538cbba05c2be5df" 1870 }, 1871 "dist": { 1872 "type": "zip", 1873 "url": "https://api.github.com/repos/nette/schema/zipball/9a39cef03a5b34c7de64f551538cbba05c2be5df", 1874 "reference": "9a39cef03a5b34c7de64f551538cbba05c2be5df", 1875 "shasum": "" 1876 }, 1877 "require": { 1878 "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0", 1879 "php": ">=7.1 <8.2" 1795 1880 }, 1796 1881 "require-dev": { … … 1834 1919 "support": { 1835 1920 "issues": "https://github.com/nette/schema/issues", 1836 "source": "https://github.com/nette/schema/tree/v1.2. 1"1837 }, 1838 "time": "2021- 03-04T17:51:11+00:00"1921 "source": "https://github.com/nette/schema/tree/v1.2.2" 1922 }, 1923 "time": "2021-10-15T11:40:02+00:00" 1839 1924 }, 1840 1925 { … … 2474 2559 { 2475 2560 "name": "psy/psysh", 2476 "version": "v0.10. 8",2561 "version": "v0.10.9", 2477 2562 "source": { 2478 2563 "type": "git", 2479 2564 "url": "https://github.com/bobthecow/psysh.git", 2480 "reference": " e4573f47750dd6c92dca5aee543fa77513cbd8d3"2481 }, 2482 "dist": { 2483 "type": "zip", 2484 "url": "https://api.github.com/repos/bobthecow/psysh/zipball/ e4573f47750dd6c92dca5aee543fa77513cbd8d3",2485 "reference": " e4573f47750dd6c92dca5aee543fa77513cbd8d3",2565 "reference": "01281336c4ae557fe4a994544f30d3a1bc204375" 2566 }, 2567 "dist": { 2568 "type": "zip", 2569 "url": "https://api.github.com/repos/bobthecow/psysh/zipball/01281336c4ae557fe4a994544f30d3a1bc204375", 2570 "reference": "01281336c4ae557fe4a994544f30d3a1bc204375", 2486 2571 "shasum": "" 2487 2572 }, … … 2543 2628 "support": { 2544 2629 "issues": "https://github.com/bobthecow/psysh/issues", 2545 "source": "https://github.com/bobthecow/psysh/tree/v0.10. 8"2546 }, 2547 "time": "2021- 04-10T16:23:39+00:00"2630 "source": "https://github.com/bobthecow/psysh/tree/v0.10.9" 2631 }, 2632 "time": "2021-10-10T13:37:39+00:00" 2548 2633 }, 2549 2634 { … … 2593 2678 { 2594 2679 "name": "ramsey/collection", 2595 "version": "1.2. 1",2680 "version": "1.2.2", 2596 2681 "source": { 2597 2682 "type": "git", 2598 2683 "url": "https://github.com/ramsey/collection.git", 2599 "reference": " eaca1dc1054ddd10cbd83c1461907bee6fb528fa"2600 }, 2601 "dist": { 2602 "type": "zip", 2603 "url": "https://api.github.com/repos/ramsey/collection/zipball/ eaca1dc1054ddd10cbd83c1461907bee6fb528fa",2604 "reference": " eaca1dc1054ddd10cbd83c1461907bee6fb528fa",2684 "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a" 2685 }, 2686 "dist": { 2687 "type": "zip", 2688 "url": "https://api.github.com/repos/ramsey/collection/zipball/cccc74ee5e328031b15640b51056ee8d3bb66c0a", 2689 "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a", 2605 2690 "shasum": "" 2606 2691 }, … … 2656 2741 "support": { 2657 2742 "issues": "https://github.com/ramsey/collection/issues", 2658 "source": "https://github.com/ramsey/collection/tree/1.2. 1"2743 "source": "https://github.com/ramsey/collection/tree/1.2.2" 2659 2744 }, 2660 2745 "funding": [ … … 2668 2753 } 2669 2754 ], 2670 "time": "2021- 08-06T03:41:06+00:00"2755 "time": "2021-10-10T03:01:02+00:00" 2671 2756 }, 2672 2757 { … … 2770 2855 { 2771 2856 "name": "swiftmailer/swiftmailer", 2772 "version": "v6. 2.7",2857 "version": "v6.3.0", 2773 2858 "source": { 2774 2859 "type": "git", 2775 2860 "url": "https://github.com/swiftmailer/swiftmailer.git", 2776 "reference": " 15f7faf8508e04471f666633addacf54c0ab5933"2777 }, 2778 "dist": { 2779 "type": "zip", 2780 "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/ 15f7faf8508e04471f666633addacf54c0ab5933",2781 "reference": " 15f7faf8508e04471f666633addacf54c0ab5933",2861 "reference": "8a5d5072dca8f48460fce2f4131fcc495eec654c" 2862 }, 2863 "dist": { 2864 "type": "zip", 2865 "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/8a5d5072dca8f48460fce2f4131fcc495eec654c", 2866 "reference": "8a5d5072dca8f48460fce2f4131fcc495eec654c", 2782 2867 "shasum": "" 2783 2868 }, … … 2791 2876 "require-dev": { 2792 2877 "mockery/mockery": "^1.0", 2793 "symfony/phpunit-bridge": "^4.4|^5. 0"2878 "symfony/phpunit-bridge": "^4.4|^5.4" 2794 2879 }, 2795 2880 "suggest": { … … 2829 2914 "support": { 2830 2915 "issues": "https://github.com/swiftmailer/swiftmailer/issues", 2831 "source": "https://github.com/swiftmailer/swiftmailer/tree/v6. 2.7"2916 "source": "https://github.com/swiftmailer/swiftmailer/tree/v6.3.0" 2832 2917 }, 2833 2918 "funding": [ … … 2841 2926 } 2842 2927 ], 2843 "time": "2021- 03-09T12:30:35+00:00"2928 "time": "2021-10-18T15:26:12+00:00" 2844 2929 }, 2845 2930 { … … 5153 5238 { 5154 5239 "name": "vlucas/phpdotenv", 5155 "version": "v5.3. 0",5240 "version": "v5.3.1", 5156 5241 "source": { 5157 5242 "type": "git", 5158 5243 "url": "https://github.com/vlucas/phpdotenv.git", 5159 "reference": " b3eac5c7ac896e52deab4a99068e3f4ab12d9e56"5160 }, 5161 "dist": { 5162 "type": "zip", 5163 "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/ b3eac5c7ac896e52deab4a99068e3f4ab12d9e56",5164 "reference": " b3eac5c7ac896e52deab4a99068e3f4ab12d9e56",5244 "reference": "accaddf133651d4b5cf81a119f25296736ffc850" 5245 }, 5246 "dist": { 5247 "type": "zip", 5248 "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/accaddf133651d4b5cf81a119f25296736ffc850", 5249 "reference": "accaddf133651d4b5cf81a119f25296736ffc850", 5165 5250 "shasum": "" 5166 5251 }, 5167 5252 "require": { 5168 5253 "ext-pcre": "*", 5169 "graham-campbell/result-type": "^1.0. 1",5254 "graham-campbell/result-type": "^1.0.2", 5170 5255 "php": "^7.1.3 || ^8.0", 5171 "phpoption/phpoption": "^1. 7.4",5172 "symfony/polyfill-ctype": "^1. 17",5173 "symfony/polyfill-mbstring": "^1. 17",5174 "symfony/polyfill-php80": "^1. 17"5256 "phpoption/phpoption": "^1.8", 5257 "symfony/polyfill-ctype": "^1.23", 5258 "symfony/polyfill-mbstring": "^1.23.1", 5259 "symfony/polyfill-php80": "^1.23.1" 5175 5260 }, 5176 5261 "require-dev": { 5177 5262 "bamarni/composer-bin-plugin": "^1.4.1", 5178 5263 "ext-filter": "*", 5179 "phpunit/phpunit": "^7.5.20 || ^8.5. 14 || ^9.5.1"5264 "phpunit/phpunit": "^7.5.20 || ^8.5.21 || ^9.5.10" 5180 5265 }, 5181 5266 "suggest": { … … 5200 5285 { 5201 5286 "name": "Graham Campbell", 5202 "email": "graham@alt-three.com", 5203 "homepage": "https://gjcampbell.co.uk/" 5287 "email": "hello@gjcampbell.co.uk" 5204 5288 }, 5205 5289 { 5206 5290 "name": "Vance Lucas", 5207 "email": "vance@vancelucas.com", 5208 "homepage": "https://vancelucas.com/" 5291 "email": "vance@vancelucas.com" 5209 5292 } 5210 5293 ], … … 5217 5300 "support": { 5218 5301 "issues": "https://github.com/vlucas/phpdotenv/issues", 5219 "source": "https://github.com/vlucas/phpdotenv/tree/v5.3. 0"5302 "source": "https://github.com/vlucas/phpdotenv/tree/v5.3.1" 5220 5303 }, 5221 5304 "funding": [ … … 5229 5312 } 5230 5313 ], 5231 "time": "2021- 01-20T15:23:13+00:00"5314 "time": "2021-10-02T19:24:42+00:00" 5232 5315 }, 5233 5316 { … … 5501 5584 { 5502 5585 "name": "facade/ignition", 5503 "version": "2.1 3.1",5586 "version": "2.15.0", 5504 5587 "source": { 5505 5588 "type": "git", 5506 5589 "url": "https://github.com/facade/ignition.git", 5507 "reference": "e3f49bef7b4165fa4b8a9dc579e7b63fa06aef78" 5508 }, 5509 "dist": { 5510 "type": "zip", 5511 "url": "https://api.github.com/repos/facade/ignition/zipball/e3f49bef7b4165fa4b8a9dc579e7b63fa06aef78", 5512 "reference": "e3f49bef7b4165fa4b8a9dc579e7b63fa06aef78", 5513 "shasum": "" 5514 }, 5515 "require": { 5590 "reference": "3ee6e94815462bcf09bca0efc1c9069685df8da3" 5591 }, 5592 "dist": { 5593 "type": "zip", 5594 "url": "https://api.github.com/repos/facade/ignition/zipball/3ee6e94815462bcf09bca0efc1c9069685df8da3", 5595 "reference": "3ee6e94815462bcf09bca0efc1c9069685df8da3", 5596 "shasum": "" 5597 }, 5598 "require": { 5599 "ext-curl": "*", 5516 5600 "ext-json": "*", 5517 5601 "ext-mbstring": "*", … … 5573 5657 "source": "https://github.com/facade/ignition" 5574 5658 }, 5575 "time": "2021- 09-13T13:01:30+00:00"5659 "time": "2021-10-11T15:24:06+00:00" 5576 5660 }, 5577 5661 { … … 5695 5779 { 5696 5780 "name": "filp/whoops", 5697 "version": "2.14. 3",5781 "version": "2.14.4", 5698 5782 "source": { 5699 5783 "type": "git", 5700 5784 "url": "https://github.com/filp/whoops.git", 5701 "reference": " 89584ce67dd32307f1063cc43846674f4679feda"5702 }, 5703 "dist": { 5704 "type": "zip", 5705 "url": "https://api.github.com/repos/filp/whoops/zipball/ 89584ce67dd32307f1063cc43846674f4679feda",5706 "reference": " 89584ce67dd32307f1063cc43846674f4679feda",5785 "reference": "f056f1fe935d9ed86e698905a957334029899895" 5786 }, 5787 "dist": { 5788 "type": "zip", 5789 "url": "https://api.github.com/repos/filp/whoops/zipball/f056f1fe935d9ed86e698905a957334029899895", 5790 "reference": "f056f1fe935d9ed86e698905a957334029899895", 5707 5791 "shasum": "" 5708 5792 }, 5709 5793 "require": { 5710 5794 "php": "^5.5.9 || ^7.0 || ^8.0", 5711 "psr/log": "^1.0.1 "5795 "psr/log": "^1.0.1 || ^2.0 || ^3.0" 5712 5796 }, 5713 5797 "require-dev": { … … 5754 5838 "support": { 5755 5839 "issues": "https://github.com/filp/whoops/issues", 5756 "source": "https://github.com/filp/whoops/tree/2.14. 3"5840 "source": "https://github.com/filp/whoops/tree/2.14.4" 5757 5841 }, 5758 5842 "funding": [ … … 5762 5846 } 5763 5847 ], 5764 "time": "2021- 09-19T12:00:00+00:00"5848 "time": "2021-10-03T12:00:00+00:00" 5765 5849 }, 5766 5850 { … … 5817 5901 { 5818 5902 "name": "laravel/sail", 5819 "version": "v1.1 0.2",5903 "version": "v1.12.0", 5820 5904 "source": { 5821 5905 "type": "git", 5822 5906 "url": "https://github.com/laravel/sail.git", 5823 "reference": " 0b9ddae87b5867e0ca3a68f3b645079054c7ace3"5824 }, 5825 "dist": { 5826 "type": "zip", 5827 "url": "https://api.github.com/repos/laravel/sail/zipball/ 0b9ddae87b5867e0ca3a68f3b645079054c7ace3",5828 "reference": " 0b9ddae87b5867e0ca3a68f3b645079054c7ace3",5907 "reference": "80f6cd93844e87ebc2e7310f9a9b9917473f5eb0" 5908 }, 5909 "dist": { 5910 "type": "zip", 5911 "url": "https://api.github.com/repos/laravel/sail/zipball/80f6cd93844e87ebc2e7310f9a9b9917473f5eb0", 5912 "reference": "80f6cd93844e87ebc2e7310f9a9b9917473f5eb0", 5829 5913 "shasum": "" 5830 5914 }, … … 5873 5957 "source": "https://github.com/laravel/sail" 5874 5958 }, 5875 "time": "2021- 09-28T15:33:02+00:00"5959 "time": "2021-10-12T15:38:11+00:00" 5876 5960 }, 5877 5961 { … … 6314 6398 { 6315 6399 "name": "phpdocumentor/type-resolver", 6316 "version": "1.5. 0",6400 "version": "1.5.1", 6317 6401 "source": { 6318 6402 "type": "git", 6319 6403 "url": "https://github.com/phpDocumentor/TypeResolver.git", 6320 "reference": " 30f38bffc6f24293dadd1823936372dfa9e86e2f"6321 }, 6322 "dist": { 6323 "type": "zip", 6324 "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/ 30f38bffc6f24293dadd1823936372dfa9e86e2f",6325 "reference": " 30f38bffc6f24293dadd1823936372dfa9e86e2f",6404 "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" 6405 }, 6406 "dist": { 6407 "type": "zip", 6408 "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", 6409 "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", 6326 6410 "shasum": "" 6327 6411 }, … … 6358 6442 "support": { 6359 6443 "issues": "https://github.com/phpDocumentor/TypeResolver/issues", 6360 "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5. 0"6361 }, 6362 "time": "2021- 09-17T15:28:14+00:00"6444 "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" 6445 }, 6446 "time": "2021-10-02T14:08:47+00:00" 6363 6447 }, 6364 6448 { … … 7703 7787 } 7704 7788 ], 7789 "abandoned": true, 7705 7790 "time": "2020-09-28T06:45:17+00:00" 7706 7791 }, -
database/factories/DepartmentFactory.php
re6c1f87 rb9c4a92 24 24 public function definition() 25 25 { 26 $location = $this->faker-> unique()->numberBetween(1, 25);26 $location = $this->faker->randomNumber('1', '1'); 27 27 Storage::disk('local')->makeDirectory('Departments/' . $location); 28 28 return [ 29 'name' => $this->faker->firstName() . " department",29 'name' => "Department" . $this->faker->unique()->firstName(), 30 30 'code' => $location, 31 'location' => Storage::disk('local')->path('') . 'Departments /'. $location,31 'location' => Storage::disk('local')->path('') . 'Departments' . DIRECTORY_SEPARATOR . $location, 32 32 'user_id' => $this->faker->numberBetween('1', '2'), 33 33 'created_at' => Carbon::now() -
database/factories/DocumentFactory.php
re6c1f87 rb9c4a92 26 26 { 27 27 28 $deptID = $this->faker->numberBetween('1', '25'); 28 $deptID = "1"; 29 $name = $this->faker->unique()->firstName(); 30 Storage::disk('local')->makeDirectory('Departments' . DIRECTORY_SEPARATOR . $deptID . DIRECTORY_SEPARATOR . $name); 29 31 30 32 return [ 31 33 'arch_id' => $deptID . "/" . $this->faker->unique()->randomNumber(), 32 'name' => $ this->faker->unique()->firstName(),34 'name' => $name, 33 35 'description' => $this->faker->realText(), 34 36 'user_id' => $this->faker->numberBetween('1', '2'), -
database/seeders/DepartmentsTableSeeder.php
re6c1f87 rb9c4a92 16 16 public function run() 17 17 { 18 Department::factory()->count( 25)->create();18 Department::factory()->count(10)->create(); 19 19 } 20 20 } -
resources/views/dashboard/departments/index.blade.php
re6c1f87 rb9c4a92 67 67 @endif 68 68 <!-- Trigger --> 69 <td>{ !! Str::substr($department->location , strlen(Storage::disk('local')->path(''))) !!}69 <td>{{ $department->location }} 70 70 <button class="btn btn-sm btn-primary text-white" data-clipboard-target="#copy_{{ $department->id }}"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard" viewBox="0 0 16 16"> 71 71 <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"/> … … 112 112 </tbody> 113 113 </table> 114 115 116 117 114 </div> 118 115 </div> -
resources/views/dashboard/documents/edit.blade.php
re6c1f87 rb9c4a92 65 65 </div> 66 66 </div> 67 67 <div class="row"> 68 <div class="col-md-6"> 69 <input type="file" class="form-control" id="file-item" name="file_item[]" multiple> 70 </div> 71 </div> 68 72 69 73 <input type="submit" value="Save changes" class="submitBtn btn btn-primary pull-right m-10"> -
resources/views/dashboard/documents/index.blade.php
re6c1f87 rb9c4a92 23 23 <i data-feather="folder" class="width-15 height-15 mr-2"></i> 24 24 Documents 25 {{-- <span class="small ml-auto">{{$totalDocs}}</span>--}}26 25 </a> 27 26 @foreach($departments as $department) 28 27 <a href="{{ route("dashboard.documents.index", ["id" => $department->id]) }}" class="list-group-item d-flex align-items-center"> 29 <i data-feather="folder" class="width-15 height-15 mr-2"></i>30 {{$department->name}}28 <i data-feather="folder" class="width-15 height-15 mr-2"></i> 29 {{$department->name}} 31 30 <span class="small ml-auto">{{$department->document->count()}}</span> 32 31 </a> … … 63 62 </div> 64 63 </div> 65 66 67 64 <div class="col-md-9 app-content"> 68 65 <div class="app-content-overlay"></div> … … 76 73 </a> 77 74 <div class="dropdown-menu"> 78 <a class="dropdown-item" href="{{route("dashboard.departments.create")}}">Department</a>79 75 <a class="dropdown-item" href="{{route("dashboard.documents.create")}}">Document</a> 80 76 </div> … … 123 119 </div> 124 120 </div> 125 <p>Documents</p> 121 @if(!Request::query('id')) 122 <h4>Documents</h4><br/> 123 @else 124 <h4> {{ $deptName }} - {{$deptCode}} </h4> 125 <br/> 126 @endif 126 127 <div class="row"> 127 128 @forelse($documents as $document) -
routes/web.php
re6c1f87 rb9c4a92 94 94 Route::delete("/documents/{id}/destroy", "Dashboard\DocumentsController@destroy")->name("dashboard.documents.destroy"); 95 95 Route::patch('/documents/toggle-important/{id}', "Dashboard\DocumentsController@toggleImportant")->name("dashboard.documents.toggleImportant"); 96 97 96 });
Note:
See TracChangeset
for help on using the changeset viewer.