Skip to content

Commit

Permalink
feat(pages): 隐私政策
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaiyuxin103 committed Dec 17, 2024
1 parent dbdf0cb commit c8356e1
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
27 changes: 27 additions & 0 deletions app/Livewire/Privacy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

namespace App\Livewire;

use App\Models\Privacy as PrivacyModel;
use Illuminate\Support\Collection;
use Illuminate\View\View;
use Livewire\Attributes\Computed;
use Livewire\Attributes\Layout;
use Livewire\Component;

class Privacy extends Component
{
#[Computed]
public function privacies(): Collection
{
return PrivacyModel::where('state', true)->get();
}

#[Layout('layouts.guest')]
public function render(): View
{
return view('livewire.privacy');
}
}
11 changes: 11 additions & 0 deletions resources/views/livewire/privacy.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div
class="mx-auto w-full py-4 sm:py-6 md:max-w-3xl lg:max-w-[40rem] lg:py-8 xl:max-w-[48rem]"
>
<div class="prose max-w-none prose-h2:mt-6">
@foreach ($this->privacies as $value)
<div id="{{ $value->slug }}">
{!! $value->content !!}
</div>
@endforeach
</div>
</div>
1 change: 1 addition & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@

Route::get('landing', App\Livewire\Landing::class)->name('landing');
Route::get('about', App\Livewire\About::class)->name('about');
Route::get('privacies', App\Livewire\Privacy::class)->name('privacies');
});

0 comments on commit c8356e1

Please sign in to comment.