Skip to content

Commit

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

declare(strict_types=1);

namespace App\Livewire;

use App\Models\Landing as LandingModel;
use Illuminate\Support\Collection;
use Illuminate\View\View;
use Livewire\Attributes\Computed;
use Livewire\Attributes\Layout;

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

#[Layout('layouts.guest')]
public function render(): View
{
return view('livewire.landing');
}
}
9 changes: 9 additions & 0 deletions resources/views/livewire/landing.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->landings as $value)
{!! $value->content !!}
@endforeach
</div>
</div>
2 changes: 2 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@
});

Route::impersonate();

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

0 comments on commit 0e72134

Please sign in to comment.