Skip to content

A free open source IT asset/license management system

Added userpics from thispersondoesnotexist.com

snipe932c1364ee7b
diff --git a/database/seeders/AssetModelSeeder.php b/database/seeders/AssetModelSeeder.php
index e8816cc509..0652fbfb84 100755
--- a/database/seeders/AssetModelSeeder.php
+++ b/database/seeders/AssetModelSeeder.php
@@ -36,8 +36,8 @@ class AssetModelSeeder extends Seeder
AssetModel::factory()->count(1)->tab3Model()->create(); // 14
// Phones
- AssetModel::factory()->count(1)->iphone6sModel()->create(); // 15
- AssetModel::factory()->count(1)->iphone7Model()->create(); // 16
+ AssetModel::factory()->count(1)->iphone11Model()->create(); // 15
+ AssetModel::factory()->count(1)->iphone12Model()->create(); // 16
// Displays
AssetModel::factory()->count(1)->ultrafine()->create(); // 17
diff --git a/database/seeders/UserSeeder.php b/database/seeders/UserSeeder.php
index c66f23265e..107e8a3372 100644
--- a/database/seeders/UserSeeder.php
+++ b/database/seeders/UserSeeder.php
@@ -4,6 +4,8 @@ namespace Database\Seeders;
use App\Models\User;
use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\Storage;
+use Illuminate\Support\Facades\Log;
class UserSeeder extends Seeder
{
@@ -20,5 +22,43 @@ class UserSeeder extends Seeder
User::factory()->count(3)->superuser()->create();
User::factory()->count(3)->admin()->create();
User::factory()->count(50)->viewAssets()->create();
+
+ $src = public_path('/img/demo/avatars/');
+ $dst = 'avatars'.'/';
+ $del_files = Storage::files($dst);
+
+ foreach ($del_files as $del_file) { // iterate files
+ $file_to_delete = str_replace($src, '', $del_file);
+ Log::debug('Deleting: '.$file_to_delete);
+ try {
+ Storage::disk('public')->delete($dst.$del_file);
+ } catch (\Exception $e) {
+ Log::debug($e);
+ }
+ }
+
+ $add_files = glob($src.'/*.*');
+ foreach ($add_files as $add_file) {
+ $file_to_copy = str_replace($src, '', $add_file);
+ Log::debug('Copying: '.$file_to_copy);
+ try {
+ Storage::disk('public')->put($dst.$file_to_copy, file_get_contents($src.$file_to_copy));
+ } catch (\Exception $e) {
+ Log::debug($e);
+ }
+ }
+
+ $users = User::orderBy('id', 'desc')->take(20)->get();
+ $file_number = 1;
+
+ foreach ($users as $user) {
+
+ $user->avatar = $file_number.'.jpg';
+ $user->save();
+ $file_number++;
+ }
+
+
+
}
}
diff --git a/public/img/demo/avatars/1.jpg b/public/img/demo/avatars/1.jpg
new file mode 100644
index 0000000000..78c59a67d5
Binary files /dev/null and b/public/img/demo/avatars/1.jpg differ
diff --git a/public/img/demo/avatars/10.jpg b/public/img/demo/avatars/10.jpg
new file mode 100644
index 0000000000..95150c433d
Binary files /dev/null and b/public/img/demo/avatars/10.jpg differ
diff --git a/public/img/demo/avatars/11.jpg b/public/img/demo/avatars/11.jpg
new file mode 100644
index 0000000000..8aa9f82911
Binary files /dev/null and b/public/img/demo/avatars/11.jpg differ
diff --git a/public/img/demo/avatars/12.jpg b/public/img/demo/avatars/12.jpg
new file mode 100644
index 0000000000..fc741d0fd0
Binary files /dev/null and b/public/img/demo/avatars/12.jpg differ
diff --git a/public/img/demo/avatars/13.jpg b/public/img/demo/avatars/13.jpg
new file mode 100644
index 0000000000..bb3634c720
Binary files /dev/null and b/public/img/demo/avatars/13.jpg differ
diff --git a/public/img/demo/avatars/14.jpg b/public/img/demo/avatars/14.jpg
new file mode 100644
index 0000000000..ee6f3bc702
Binary files /dev/null and b/public/img/demo/avatars/14.jpg differ
diff --git a/public/img/demo/avatars/15.jpg b/public/img/demo/avatars/15.jpg
new file mode 100644
index 0000000000..e32542453a
Binary files /dev/null and b/public/img/demo/avatars/15.jpg differ
diff --git a/public/img/demo/avatars/16.jpg b/public/img/demo/avatars/16.jpg
new file mode 100644
index 0000000000..ca16a1ac51
Binary files /dev/null and b/public/img/demo/avatars/16.jpg differ
diff --git a/public/img/demo/avatars/17.jpg b/public/img/demo/avatars/17.jpg
new file mode 100644
index 0000000000..5e1589053c
Binary files /dev/null and b/public/img/demo/avatars/17.jpg differ
diff --git a/public/img/demo/avatars/18.jpg b/public/img/demo/avatars/18.jpg
new file mode 100644
index 0000000000..34cd548539
Binary files /dev/null and b/public/img/demo/avatars/18.jpg differ
diff --git a/public/img/demo/avatars/19.jpg b/public/img/demo/avatars/19.jpg
new file mode 100644
index 0000000000..0ad858b003
Binary files /dev/null and b/public/img/demo/avatars/19.jpg differ
diff --git a/public/img/demo/avatars/2.jpg b/public/img/demo/avatars/2.jpg
new file mode 100644
index 0000000000..2e929c8540
Binary files /dev/null and b/public/img/demo/avatars/2.jpg differ
diff --git a/public/img/demo/avatars/20.jpg b/public/img/demo/avatars/20.jpg
new file mode 100644
index 0000000000..81d90c7862
Binary files /dev/null and b/public/img/demo/avatars/20.jpg differ
diff --git a/public/img/demo/avatars/3.jpg b/public/img/demo/avatars/3.jpg
new file mode 100644
index 0000000000..751b3dad8f
Binary files /dev/null and b/public/img/demo/avatars/3.jpg differ
diff --git a/public/img/demo/avatars/4.jpg b/public/img/demo/avatars/4.jpg
new file mode 100644
index 0000000000..aab81c5592
Binary files /dev/null and b/public/img/demo/avatars/4.jpg differ
diff --git a/public/img/demo/avatars/5.jpg b/public/img/demo/avatars/5.jpg
new file mode 100644
index 0000000000..118defa791
Binary files /dev/null and b/public/img/demo/avatars/5.jpg differ
diff --git a/public/img/demo/avatars/6.jpg b/public/img/demo/avatars/6.jpg
new file mode 100644
index 0000000000..113a1d2692
Binary files /dev/null and b/public/img/demo/avatars/6.jpg differ
diff --git a/public/img/demo/avatars/7.jpg b/public/img/demo/avatars/7.jpg
new file mode 100644
index 0000000000..1051532161
Binary files /dev/null and b/public/img/demo/avatars/7.jpg differ
diff --git a/public/img/demo/avatars/8.jpg b/public/img/demo/avatars/8.jpg
new file mode 100644
index 0000000000..c9691ac944
Binary files /dev/null and b/public/img/demo/avatars/8.jpg differ
diff --git a/public/img/demo/avatars/9.jpg b/public/img/demo/avatars/9.jpg
new file mode 100644
index 0000000000..544f7c907d
Binary files /dev/null and b/public/img/demo/avatars/9.jpg differ