From 7abbdbd05625c3bc4298e1582616976e000f29a9 Mon Sep 17 00:00:00 2001 From: marcio1002 Date: Fri, 20 Oct 2023 18:25:37 -0300 Subject: [PATCH] change to user import endpoint --- app/Http/Controllers/UserController.php | 3 +-- app/Imports/UsersWithSmartUsersImport.php | 2 +- composer.json | 1 + config/excel.php | 2 +- storage/framework/cache/.gitignore | 1 - 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 784189a..ad7e86d 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -147,9 +147,8 @@ class UserController extends Controller $filename = preg_replace("/imports\//", "", $user_imports_path); - Excel::import(new UsersWithSmartUsersImport($file_logos), $filename, $driver); + Excel::import(new UsersWithSmartUsersImport($file_logos), $user_imports_path, $driver); - sleep(2000); Storage::disk($driver)->delete($filename); return response() diff --git a/app/Imports/UsersWithSmartUsersImport.php b/app/Imports/UsersWithSmartUsersImport.php index ebe70ca..a0cf1e4 100644 --- a/app/Imports/UsersWithSmartUsersImport.php +++ b/app/Imports/UsersWithSmartUsersImport.php @@ -98,7 +98,7 @@ class UsersWithSmartUsersImport implements ToCollection private function uploadProfilePictures() { - $temp_extract_files_path = storage_path('app/extract'); + $temp_extract_files_path = storage_path('app/extracts'); $zip = Zip::open($this->files_logos); $zip->extract($temp_extract_files_path); diff --git a/composer.json b/composer.json index 8a6f3a2..b45b128 100644 --- a/composer.json +++ b/composer.json @@ -74,6 +74,7 @@ "@php artisan config:clear --ansi", "@php artisan schedule:clear-cache --ansi" ], + "authorized-files": "sudo chown -R www-data:www-data storage/ storage/framework/cache storage/framework/cache/data bootstrap/cache/ public/", "dev": "@php artisan serve --host=0.0.0.0 --port=8080 --ansi" }, "extra": { diff --git a/config/excel.php b/config/excel.php index 987883e..b142ef5 100644 --- a/config/excel.php +++ b/config/excel.php @@ -294,7 +294,7 @@ return [ | storing reading or downloading. Here you can customize that path. | */ - 'local_path' => storage_path('framework/cache/laravel-excel'), + 'local_path' => storage_path('framework/cache/laravel-excel'), /* |-------------------------------------------------------------------------- diff --git a/storage/framework/cache/.gitignore b/storage/framework/cache/.gitignore index 01e4a6c..d6b7ef3 100644 --- a/storage/framework/cache/.gitignore +++ b/storage/framework/cache/.gitignore @@ -1,3 +1,2 @@ * -!data/ !.gitignore