First commit
This commit is contained in:
commit
7cf3558ba7
12933 changed files with 1180047 additions and 0 deletions
43
app/Livewire/Web/Components/Sections/MagazinList.php
Normal file
43
app/Livewire/Web/Components/Sections/MagazinList.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace App\Livewire\Web\Components\Sections;
|
||||
|
||||
use Livewire\Component;
|
||||
|
||||
class MagazinList extends Component
|
||||
{
|
||||
public $posts = [];
|
||||
public $content = [];
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->loadPosts();
|
||||
$this->loadThemeContent();
|
||||
}
|
||||
|
||||
private function loadPosts()
|
||||
{
|
||||
$articles = config('content.articles', []);
|
||||
$this->posts = collect($articles)->map(function ($article) {
|
||||
return [
|
||||
'id' => $article['id'],
|
||||
'title' => $article['title'],
|
||||
'excerpt' => $article['content']['intro'], // Using intro as excerpt
|
||||
'image' => $article['image'],
|
||||
'date' => $article['date'],
|
||||
'readTime' => $article['readTime'],
|
||||
];
|
||||
})->all();
|
||||
}
|
||||
|
||||
private function loadThemeContent()
|
||||
{
|
||||
$theme = config('app.theme', 'b2in');
|
||||
$this->content = config("content.themes.{$theme}.magazin_list", []);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.web.components.sections.magazin-list');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue