Update source into github
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
namespace App\View\Composers;
|
||||
|
||||
use App\Repositories\Menu\MenuRepositoryInterface;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class MenuComposer
|
||||
{
|
||||
protected MenuRepositoryInterface $menuRepositoryInterface;
|
||||
public function __construct(MenuRepositoryInterface $menuRepositoryInterface)
|
||||
{
|
||||
$this->menuRepositoryInterface = $menuRepositoryInterface;
|
||||
}
|
||||
|
||||
public function compose(View $view): void
|
||||
{
|
||||
$menus = $this->menuRepositoryInterface->getTree();
|
||||
|
||||
$view->with('menus', $menus);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Composers\Posts;
|
||||
|
||||
|
||||
use App\Repositories\Menu\MenuRepositoryInterface;
|
||||
use App\Repositories\Post\PostRepositoryInterface;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class PostComposer
|
||||
{
|
||||
protected $postRepositoryInterface;
|
||||
|
||||
public function __construct(PostRepositoryInterface $postRepositoryInterface)
|
||||
{
|
||||
$this->postRepositoryInterface = $postRepositoryInterface;
|
||||
}
|
||||
|
||||
public function compose(View $view): void
|
||||
{
|
||||
$posts = $this->postRepositoryInterface->getAll();
|
||||
|
||||
$view->with('posts', $posts);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user