Skip to content

Commit

Permalink
feat(pages): 关于我们
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaiyuxin103 committed Nov 26, 2024
1 parent 0e72134 commit 58f45e3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
24 changes: 24 additions & 0 deletions app/Livewire/About.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

namespace App\Livewire;

use App\Models\About as AboutModel;
use Illuminate\Support\Collection;
use Illuminate\View\View;
use Livewire\Attributes\Computed;

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

public function render(): View
{
return view('livewire.about');
}
}
9 changes: 9 additions & 0 deletions resources/views/livewire/about.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<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->abouts as $value)
{!! $value->content !!}
@endforeach
</div>
</div>
1 change: 1 addition & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@
Route::impersonate();

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

0 comments on commit 58f45e3

Please sign in to comment.