Skip to content

Commit 5296eef

Browse files
committed
Add demo files
1 parent c2fee5f commit 5296eef

27 files changed

+62
-0
lines changed

scripts/demo/DemoSeeder.php

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
3+
namespace Database\Seeders;
4+
5+
use App\Actions\Album\SetProtectionPolicy;
6+
use App\Http\Resources\Models\Utils\AlbumProtectionPolicy;
7+
use App\Models\Album;
8+
use App\Models\Configs;
9+
use Illuminate\Database\Seeder;
10+
11+
class DemoSeeder extends Seeder
12+
{
13+
/**
14+
* Seed the application's database.
15+
*/
16+
public function run(): void
17+
{
18+
$setProtections = new SetProtectionPolicy();
19+
20+
$tulipsProtectionPolicy = new AlbumProtectionPolicy(
21+
is_public: true,
22+
is_link_required: false,
23+
is_nsfw: false,
24+
grants_full_photo_access: false,
25+
grants_download: false,
26+
grants_upload: false,
27+
is_password_required: false,
28+
);
29+
/** @var Album $tulipAlbum */
30+
$tulipAlbum = Album::query()
31+
->select(['albums.*'])
32+
->join('base_albums', 'base_albums.id', '=', 'albums.id')
33+
->where('title', '=', 'Tulips')->first();
34+
$setProtections->do($tulipAlbum, $tulipsProtectionPolicy, false, null);
35+
36+
$catProtectionPolicy = new AlbumProtectionPolicy(
37+
is_public: true,
38+
is_link_required: false,
39+
is_nsfw: true,
40+
grants_full_photo_access: true,
41+
grants_download: true,
42+
grants_upload: false,
43+
is_password_required: false,
44+
);
45+
/** @var Album $catAlbum */
46+
$catAlbum = Album::query()
47+
->select(['albums.*'])
48+
->join('base_albums', 'base_albums.id', '=', 'albums.id')
49+
->where('title', '=', 'Cat')->first();
50+
$setProtections->do($catAlbum, $catProtectionPolicy, false, null);
51+
52+
Configs::set('nsfw_banner_blur_backdrop', true);
53+
Configs::set('nsfw_visible', true);
54+
Configs::set('nsfw_warning', true);
55+
Configs::set('allow_online_git_pull', false);
56+
Configs::set('force_migration_in_production', false);
57+
Configs::set('apply_composer_update', false);
58+
Configs::set('landing_page_enable', true);
59+
Configs::set('landing_title', 'Lychee demo');
60+
Configs::set('landing_subtitle', 'admin account: admin admin');
61+
}
62+
}
1020 KB
Loading
821 KB
Loading
1.19 MB
Loading
1.15 MB
Loading
975 KB
Loading
716 KB
Loading
787 KB
Loading
727 KB
Loading
222 KB
Loading

0 commit comments

Comments
 (0)