Commit 991637f9 authored by TTS Tran Viet Anh's avatar TTS Tran Viet Anh

Merge branch 'feature/index' into 'dev'

Feature/index

See merge request !2
parents 540ee1db ad218458
<?php
namespace App\Http\Controllers;
use App\Models\Post;
use App\Models\Product;
use App\Models\ProductCategory;
use Illuminate\Http\Request;
class HomeController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$productCategories = ProductCategory::noParent()->get();
$latestDrops = Product::with('productAttributes')
->enabled()
->latest()
->take(4)
->get();
$products = Product::with('productAttributes')
->enabled()
->latest()
->take(8)
->get();
$latestBlogs = Post::with('user')
->published()
->latest()
->take(3)
->get();
return view('client.index', compact('latestDrops', 'productCategories', 'products', 'latestBlogs'));
}
public function getProductsByCategory(Request $request)
{
$category = ProductCategory::findOrFail($request->cat);
$productsByCategory = Product::ofCategories($category->ids)
->latest()
->take(8)
->get();
return view('client.products_by_category', compact('productsByCategory'));
}
}
...@@ -26,4 +26,9 @@ public function user() ...@@ -26,4 +26,9 @@ public function user()
{ {
return $this->belongsTo(User::class); return $this->belongsTo(User::class);
} }
public function scopePublished($query)
{
return $query->where('status', Post::STATUS_PUBLISHED);
}
} }
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
class PostCategory extends Model class PostCategory extends Model
{ {
const STATUS_ENABLE = 1; const STATUS_ENABLED = 1;
const STATUS_DISABLE = 2; const STATUS_DISABLED = 2;
const STATUS_DELETED = 3; const STATUS_DELETED = 3;
use HasFactory, SoftDeletes; use HasFactory, SoftDeletes;
...@@ -28,6 +28,11 @@ public function parent() ...@@ -28,6 +28,11 @@ public function parent()
public function children() public function children()
{ {
return $this->belongsTo(PostCategory::class, 'parent_id'); return $this->hasMany(PostCategory::class, 'parent_id');
}
public function scopeNoParent($query)
{
return $query->whereNull('parent_id');
} }
} }
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
class Product extends Model class Product extends Model
{ {
const STATUS_ENABLE = 1; const STATUS_ENABLED = 1;
const STATUS_DISABLE = 2; const STATUS_DISABLED = 2;
const STATUS_DELETED = 3; const STATUS_DELETED = 3;
use HasFactory, SoftDeletes; use HasFactory, SoftDeletes;
...@@ -25,4 +25,14 @@ public function productAttributes() ...@@ -25,4 +25,14 @@ public function productAttributes()
{ {
return $this->hasMany(ProductAttribute::class); return $this->hasMany(ProductAttribute::class);
} }
public function scopeEnabled($query)
{
return $query->where('status', Product::STATUS_ENABLED);
}
public function scopeOfCategories($query, $cat_ids)
{
return $query->whereIn('product_category_id', $cat_ids);
}
} }
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
class ProductCategory extends Model class ProductCategory extends Model
{ {
const STATUS_ENABLE = 1; const STATUS_ENABLED = 1;
const STATUS_DISABLE = 2; const STATUS_DISABLE = 2;
const STATUS_DELETED = 3; const STATUS_DELETED = 3;
...@@ -28,6 +28,16 @@ public function parent() ...@@ -28,6 +28,16 @@ public function parent()
public function children() public function children()
{ {
return $this->belongsTo(ProductCategory::class, 'parent_id'); return $this->hasMany(ProductCategory::class, 'parent_id');
}
public function getIdsAttribute()
{
return collect($this->children->pluck('id'))->prepend($this->id)->all();
}
public function scopeNoParent($query)
{
return $query->whereNull('parent_id');
} }
} }
<?php
namespace Database\Factories;
use App\Models\PostCategory;
use Illuminate\Database\Eloquent\Factories\Factory;
class PostCategoryFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => $this->faker->sentence(1),
'image' => $this->faker->imageUrl(80, 640, 'Post category', true),
'parent_id' => rand(0, 1) ? null : rand(1, 5),
'status' => PostCategory::STATUS_ENABLED,
'ordering' => rand(1, 3),
];
}
}
<?php
namespace Database\Factories;
use App\Models\Post;
use App\Models\PostCategory;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
class PostFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'title' => $this->faker->sentence(),
'content' => $this->faker->paragraph(),
'image' => $this->faker->imageUrl(640, 480, 'post', true),
'user_id' => User::inRandomOrder()->first()->id ?? null,
'post_category_id' => PostCategory::inRandomOrder()->first()->id ?? null,
'publish_date' => $this->faker->date(),
'status' => Post::STATUS_PUBLISHED,
];
}
}
<?php
namespace Database\Factories;
use App\Models\Product;
use Illuminate\Database\Eloquent\Factories\Factory;
class ProductAttributeFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'size' => $this->faker->randomElement(['S', 'M', 'L', 'XL']),
'color' => $this->faker->safeColorName(),
'quantity' => $this->faker->numberBetween(0, 100),
'product_id' => Product::inRandomOrder()->first()->id ?? null,
];
}
}
<?php
namespace Database\Factories;
use App\Models\ProductCategory;
use Illuminate\Database\Eloquent\Factories\Factory;
class ProductCategoryFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => $this->faker->sentence(1),
'image' => $this->faker->imageUrl(80, 640, 'product category', true),
'parent_id' => rand(0, 1) ? null : rand(1, 5),
'status' => ProductCategory::STATUS_ENABLED,
'ordering' => rand(1, 3),
];
}
}
<?php
namespace Database\Factories;
use App\Models\Product;
use App\Models\ProductCategory;
use Illuminate\Database\Eloquent\Factories\Factory;
class ProductFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => $this->faker->sentence(2),
'image' => $this->faker->imageUrl(480, 640, 'products', true),
'description' => $this->faker->paragraph(2),
'price' => $this->faker->randomFloat(2, 10, 200),
'product_category_id' => ProductCategory::inRandomOrder()->first()->id ?? null,
'stock' => $this->faker->numberBetween(0, 200),
'status' => Product::STATUS_ENABLED,
];
}
}
...@@ -17,6 +17,8 @@ public function definition() ...@@ -17,6 +17,8 @@ public function definition()
return [ return [
'name' => $this->faker->name(), 'name' => $this->faker->name(),
'email' => $this->faker->unique()->safeEmail(), 'email' => $this->faker->unique()->safeEmail(),
'phone' => $this->faker->phoneNumber(),
'address' => $this->faker->address(),
'email_verified_at' => now(), 'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10), 'remember_token' => Str::random(10),
......
...@@ -22,7 +22,7 @@ public function up() ...@@ -22,7 +22,7 @@ public function up()
$table->decimal('price', 8, 2); $table->decimal('price', 8, 2);
$table->unsignedInteger('product_category_id'); $table->unsignedInteger('product_category_id');
$table->unsignedInteger('stock'); $table->unsignedInteger('stock');
$table->unsignedTinyInteger('status')->default(Product::STATUS_ENABLE); $table->unsignedTinyInteger('status')->default(Product::STATUS_ENABLED);
$table->softDeletes(); $table->softDeletes();
$table->timestamps(); $table->timestamps();
}); });
......
...@@ -18,6 +18,7 @@ public function up() ...@@ -18,6 +18,7 @@ public function up()
$table->id(); $table->id();
$table->string('title'); $table->string('title');
$table->text('content')->nullable()->default(null); $table->text('content')->nullable()->default(null);
$table->string('image');
$table->unsignedInteger('user_id'); $table->unsignedInteger('user_id');
$table->unsignedInteger('post_category_id'); $table->unsignedInteger('post_category_id');
$table->date('publish_date')->nullable(); $table->date('publish_date')->nullable();
......
...@@ -18,8 +18,8 @@ public function up() ...@@ -18,8 +18,8 @@ public function up()
$table->id(); $table->id();
$table->string('name'); $table->string('name');
$table->string('image'); $table->string('image');
$table->unsignedInteger('parent_id'); $table->unsignedInteger('parent_id')->nullable();
$table->unsignedTinyInteger('status')->default(ProductCategory::STATUS_ENABLE); $table->unsignedTinyInteger('status')->default(ProductCategory::STATUS_ENABLED);
$table->unsignedInteger('ordering'); $table->unsignedInteger('ordering');
$table->softDeletes(); $table->softDeletes();
$table->timestamps(); $table->timestamps();
......
...@@ -18,8 +18,8 @@ public function up() ...@@ -18,8 +18,8 @@ public function up()
$table->id(); $table->id();
$table->string('name'); $table->string('name');
$table->string('image'); $table->string('image');
$table->unsignedInteger('parent_id'); $table->unsignedInteger('parent_id')->nullable();
$table->unsignedTinyInteger('status')->default(PostCategory::STATUS_ENABLE); $table->unsignedTinyInteger('status')->default(PostCategory::STATUS_ENABLED);
$table->unsignedInteger('ordering'); $table->unsignedInteger('ordering');
$table->softDeletes(); $table->softDeletes();
$table->timestamps(); $table->timestamps();
......
...@@ -13,6 +13,11 @@ class DatabaseSeeder extends Seeder ...@@ -13,6 +13,11 @@ class DatabaseSeeder extends Seeder
*/ */
public function run() public function run()
{ {
// \App\Models\User::factory(10)->create(); \App\Models\PostCategory::factory(5)->create();
\App\Models\ProductCategory::factory(5)->create();
\App\Models\User::factory(5)->create();
\App\Models\Post::factory(10)->create();
\App\Models\Product::factory(10)->create();
\App\Models\ProductAttribute::factory(50)->create();
} }
} }
@extends('layout.app')
@section('content')
{{-- Carousel --}}
<div id="carouselExampleControls" class="carousel carousel-dark slide" data-bs-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="{{ asset('assets') }}/images/1.jpg" class="d-block w-100" alt="...">
<div class="carousel-caption d-md-block">
<h4>First slide label</h4>
<span>Some representative placeholder content for the first slide.</span>
</div>
</div>
<div class="carousel-item">
<img src="{{ asset('assets') }}/images/2.jpg" class="d-block w-100" alt="...">
<div class="carousel-caption d-md-block">
<h4>Second slide label</h4>
<span>Some representative placeholder content for the second slide.</span>
</div>
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleControls" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleControls" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
{{-- Sub banner --}}
<div class="row m-5">
<div class="col">
<img src="{{ asset('assets') }}/images/sub-banner1.jpg" class="d-block w-100" alt="...">
</div>
<div class="col">
<img src="{{ asset('assets') }}/images/sub-banner2.jpg" class="d-block w-100" alt="...">
</div>
</div>
{{-- Latest Drops --}}
<div class="container">
<div class="text-center">
<span>Special offer</span>
<h2>Latest Drops</h2>
<p class="mt-4">
Looking for the latest trends in clothing, shoes and accessories? <br>
Welcome to our 'Latest Drops' edit, bringing you all the latest styles from all your fave brands.
</p>
</div>
<div class="container">
<div class="row">
@foreach ($latestDrops as $latestDrop)
<div class="col">
<div class="card">
<img src="{{ $latestDrop->image }}" class="card-img-top" alt="...">
<div class="card-body">
{{-- rating --}}
<div class="rating">
<span class="fa fa-star" style="color:orange"></span>
<span class="fa fa-star" style="color:orange"></span>
<span class="fa fa-star" style="color:orange"></span>
<span class="fa fa-star" style="color:orange"></span>
<span class="fa fa-star"></span>
</div>
{{-- rating --}}
<h6 class="card-title">{{ $latestDrop->name }}</h6>
<h5>{{ $latestDrop->price }}</h5>
<div class="color">
@foreach ($latestDrop->productAttributes as $productAttribute)
<span class="dot mx-"
style="height: 20px; width: 20px;background-color:{{ $productAttribute->color }}; border-radius: 50%;
display: inline-block;"></span>
@endforeach
</div>
</div>
</div>
</div>
@endforeach
</div>
</div>
</div>
{{-- Banner --}}
<div class="my-5"
style="background: url('{{ asset('assets') }}/images/bg1.jpg'); background-size: cover; height:500px ">
</div>
{{-- Product --}}
<div class="container">
<div class="text-center">
<span>Exclusive Products</span>
<h2>Everyday Casual</h2>
<ul style="list-style: none;">
@foreach ($productCategories as $productCategory)
<li class="mx-3" style="display: inline-block; cursor: pointer">
<h6 id="productCategory{{ $productCategory->id }}">
{{ $productCategory->name }}
</h6>
</li>
<script>
$(document).ready(function() {
$('#productCategory{{ $productCategory->id }}').click(function() {
$.ajax({
type: "GET",
url: "{{ route('productsByCategory') }}",
data: {
cat: {{ $productCategory->id }},
},
success: function(data) {
$('#productsByCategory').html(data);
}
});
});
});
</script>
@endforeach
</ul>
</div>
<div class="container" id="productsByCategory">
<div class="row">
@foreach ($products as $product)
<div class="col-3 my-2">
<div class="card">
<img src="{{ $product->image }}" class="card-img-top" alt="...">
<div class="card-body">
{{-- rating --}}
<div class="rating">
<span class="fa fa-star" style="color:orange"></span>
<span class="fa fa-star" style="color:orange"></span>
<span class="fa fa-star" style="color:orange"></span>
<span class="fa fa-star" style="color:orange"></span>
<span class="fa fa-star"></span>
</div>
{{-- rating --}}
<h6 class="card-title">{{ $product->name }}</h6>
<h5>{{ $product->price }}</h5>
<div class="color">
@foreach ($product->productAttributes as $productAttribute)
<span class="dot mx-"
style="height: 20px; width: 20px;background-color:{{ $productAttribute->color }}; border-radius: 50%;
display: inline-block;"></span>
@endforeach
</div>
</div>
</div>
</div>
@endforeach
</div>
</div>
</div>
{{-- Service --}}
<div class="container">
<section class="d-flex justify-content-lg-between p-5 m-5 border-bottom border-top">
<div class="me-5 d-lg-block">
<h6>Free Shipping</h6>
<span>Free Shipping World Wide</span>
</div>
<div class="vr"></div>
<div class="me-5 d-lg-block">
<h6>24 X 7 Service</h6>
<span>Online Service For New Customer</span>
</div>
<div class="vr"></div>
<div class="me-5 d-lg-block">
<h6>Festival Offer</h6>
<span>New Online Special Festival Offer</span>
</div>
</section>
</div>
{{-- Blog --}}
<div class="container">
<div class="text-center">
<span class="mb-3">From The Blog</span>
<h2 class="mb-4">FASHION FOR YOU</h2>
</div>
<div class="container">
<div class="row">
@foreach ($latestBlogs as $blog)
<div class="col-4">
<div class="card border-0">
<img src="{{ $blog->image }}" class="card-img-top" alt="...">
<div class="card-body">
<h6 class="card-title">{{ $blog->publish_date }}</h6>
<h5>{{ $blog->title }}</h5>
<span>by: {{ $blog->user->name }}</span>
</div>
</div>
</div>
@endforeach
</div>
</div>
</div>
</div>
@endsection
<div class="row">
@foreach ($productsByCategory as $productByCategory)
<div class="col-3">
<div class="card">
<img src="{{ $productByCategory->image }}" class="card-img-top" alt="...">
<div class="card-body">
{{-- rating --}}
<div class="rating">
<span class="fa fa-star" style="color:orange"></span>
<span class="fa fa-star" style="color:orange"></span>
<span class="fa fa-star" style="color:orange"></span>
<span class="fa fa-star" style="color:orange"></span>
<span class="fa fa-star"></span>
</div>
{{-- rating --}}
<h6 class="card-title">{{ $productByCategory->name }}</h6>
<h5>{{ $productByCategory->price }}</h5>
<div class="color">
@foreach ($productByCategory->productAttributes as $productAttribute)
<span class="dot mx-"
style="height: 20px; width: 20px;background-color:{{ $productAttribute->color }}; border-radius: 50%;
display: inline-block;"></span>
@endforeach
</div>
</div>
</div>
</div>
@endforeach
</div>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
{{-- boostrap --}}
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous">
</script>
{{-- fontawsome --}}
<script src="https://kit.fontawesome.com/47b2d8ad40.js" crossorigin="anonymous"></script>
{{-- Jquery --}}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<title>Document</title>
</head>
<body>
{{-- Navbar --}}
@include('layout.navbar')
{{-- Navbar --}}
{{-- Content --}}
<div class="wrapper">
<div class="content">
@yield('content')
</div>
</div>
{{-- Content --}}
<!-- Footer -->
@include('layout.footer')
<!-- Footer -->
</body>
</html>
<footer class="text-center text-lg-start bg-light text-muted">
<!-- Section: Social media -->
<section class="container d-flex justify-content-center justify-content-lg-between p-4 border-bottom">
<!-- Left -->
<div class="me-5 d-none d-lg-block">
<h5>KNOW IT ALL FIRST!</h5>
<span>Never Miss Anything From Multikart By Signing Up To Our Newsletter.</span>
</div>
<!-- Left -->
<div class="vr"></div>
<!-- Right -->
<div class="form-group mb-3">
<div class="input-group">
<input type="text" class="form-control" placeholder="Recipient's username"
aria-label="Recipient's username" aria-describedby="button-addon2">
<button class="btn btn-outline-secondary" type="button" id="button-addon2">Button</button>
</div>
</div>
<!-- Right -->
</section>
<!-- Section: Social media -->
<!-- Section: Links -->
<section class="container border-bottom">
<div class="container text-center text-md-start mt-5">
<!-- Grid row -->
<div class="row mt-3">
<!-- Grid column -->
<div class="col-md-3 col-lg-4 col-xl-3 mx-auto mb-4">
<!-- Content -->
<h6 class="text-uppercase fw-bold mb-4">
<img src="{{ asset('assets') }}/images/logo.png" alt="" srcset="">
</h6>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam,
</p>
<div>
<a href="" class="me-4 text-reset">
<i class="fab fa-facebook-f"></i>
</a>
<a href="" class="me-4 text-reset">
<i class="fab fa-twitter"></i>
</a>
<a href="" class="me-4 text-reset">
<i class="fab fa-google"></i>
</a>
<a href="" class="me-4 text-reset">
<i class="fab fa-instagram"></i>
</a>
<a href="" class="me-4 text-reset">
<i class="fab fa-linkedin"></i>
</a>
<a href="" class="me-4 text-reset">
<i class="fab fa-github"></i>
</a>
</div>
</div>
<!-- Grid column -->
<!-- Grid column -->
<div class="col-md-2 col-lg-2 col-xl-2 mx-auto mb-4">
<!-- Links -->
<h6 class="text-uppercase fw-bold mb-4">
My Account
</h6>
<p>
<a href="#!" class="text-reset">Mens</a>
</p>
<p>
<a href="#!" class="text-reset">Womens</a>
</p>
<p>
<a href="#!" class="text-reset">Clothing</a>
</p>
<p>
<a href="#!" class="text-reset">Accessories</a>
</p>
<p>
<a href="#!" class="text-reset">Featured</a>
</p>
</div>
<!-- Grid column -->
<!-- Grid column -->
<div class="col-md-3 col-lg-2 col-xl-2 mx-auto mb-4">
<!-- Links -->
<h6 class="text-uppercase fw-bold mb-4">
Why We Choose
</h6>
<p>
<a href="#!" class="text-reset">Shipping & Return</a>
</p>
<p>
<a href="#!" class="text-reset">Secure Shopping</a>
</p>
<p>
<a href="#!" class="text-reset">Gallary</a>
</p>
<p>
<a href="#!" class="text-reset">Gallary</a>
</p>
<p>
<a href="#!" class="text-reset">Contacts</a>
</p>
</div>
<!-- Grid column -->
<!-- Grid column -->
<div class="col-md-4 col-lg-3 col-xl-3 mx-auto mb-md-0 mb-4">
<!-- Links -->
<h6 class="text-uppercase fw-bold mb-4">Store Infomation</h6>
<p>
<i class="fa-solid fa-location-dot fa-xs"></i>
Multikart Demo Store, Demo Store India 345-659
</p>
<p>
<i class="fas fa-phone me-3 fa-xs"></i>
Call Us: 123-456-7898
</p>
<p>
<i class="fas fa-envelope me-3 fa-xs"></i>
Email Us: Support@Fiot.Com
</p>
<p>
<i class="fa-solid fa-fax fa-xs"></i>
Fax: 123456
</p>
</div>
<!-- Grid column -->
</div>
<!-- Grid row -->
</div>
</section>
<!-- Section: Links -->
<!-- Copyright -->
<div class="text-center p-4">
<div class="row">
<div class="col">© 2017-18 themeforest powered by pixelstrap</div>
<div class="col">
<img src="{{ asset('assets') }}/images/american-express.png" alt="" class="ms-3">
<img src="{{ asset('assets') }}/images/visa.png" alt="" class="ms-3">
<img src="{{ asset('assets') }}/images/discover.png" alt="" class="ms-3">
<img src="{{ asset('assets') }}/images/mastercard.png" alt="" class="ms-3">
<img src="{{ asset('assets') }}/images/paypal.png" alt="" class="ms-3">
</div>
</div>
</div>
<!-- Copyright -->
</footer>
<nav class="navbar navbar-expand-lg bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">
<img src="{{ asset('assets') }}/images/logo.png" alt="" srcset="">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown"
aria-expanded="false">
Feature
</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown"
aria-expanded="false">
Product
</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown"
aria-expanded="false">
Blog
</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="#" role="button">
Cart
</a>
</li>
</ul>
<form class="d-flex" role="search">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</div>
</nav>
<?php <?php
use App\Http\Controllers\HomeController;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
/* /*
...@@ -13,6 +14,7 @@ ...@@ -13,6 +14,7 @@
| |
*/ */
Route::get('/', function () { Route::controller(HomeController::class)->group(function () {
return view('welcome'); Route::get('/', 'index');
Route::get('/productsByCategory', 'getProductsByCategory')->name('productsByCategory');
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment