Add (category)
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
use App\Views\Composers\ParentCategoryComposer;
|
use App\Views\Composers\CategoryComposer;
|
||||||
use Illuminate\Support\Facades\View;
|
use Illuminate\Support\Facades\View;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ public function register()
|
|||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
// Using class based composers...
|
// Using class based composers...
|
||||||
View::composer('front.layouts.partials.nav', ParentCategoryComposer::class);
|
View::composer('front.layouts.partials.nav', CategoryComposer::class);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
use App\Models\Category;
|
use App\Models\Category;
|
||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
|
|
||||||
class ParentCategoryComposer
|
class CategoryComposer
|
||||||
{
|
{
|
||||||
public function compose(View $view)
|
public function compose(View $view)
|
||||||
{
|
{
|
||||||
$view->with('parent_categories', Category::whereNull('parent_id')->get());
|
$view->with('categories', Category::get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<div class="w-full shadow-sm bg-black text-white">
|
<div class="w-full shadow-sm bg-black text-white">
|
||||||
<header class="container lh-1 py-3">
|
<header class="container-lg lh-1 py-3">
|
||||||
<div class="row d-block d-md-flex justify-content-center align-items-center">
|
<div class="row d-block d-md-flex justify-content-center align-items-center">
|
||||||
|
|
||||||
<div class="col-12 col-md-5 col-lg-4 py-2 py-md-0 text-center text-md-start">
|
<div class="col-12 col-md-5 col-lg-4 py-2 py-md-0 text-center text-md-start">
|
||||||
@@ -15,3 +15,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="w-full bg-dark text-white d-none d-md-block">
|
||||||
|
<div class="container-lg text-center py-2">
|
||||||
|
@foreach ($categories as $category)
|
||||||
|
<a href="#" class="text-white mx-3 font-family-roboto-condensed text-uppercase">{{ $category->name }}</a>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user