Skip to content

Commit

Permalink
Add collection, product and product detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
iambasanta committed Jun 5, 2023
1 parent 7e09398 commit 68928e9
Show file tree
Hide file tree
Showing 5 changed files with 650 additions and 0 deletions.
21 changes: 21 additions & 0 deletions app/Http/Controllers/CollectionController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace App\Http\Controllers;

use App\Models\Category;
use Illuminate\Http\Request;

class CollectionController extends Controller
{
public function index() {
return view('frontend.collections.index');
}

public function products(Category $category) {
return view('frontend.products.index');
}

public function show(Category $category) {
return view('frontend.products.show');
}
}
67 changes: 67 additions & 0 deletions resources/views/frontend/collections/index.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<x-frontend.app title="Collections">
<div class="mx-auto max-w-7xl px-4 py-24 sm:px-6 sm:py-32 lg:px-8">
<h2 class="text-2xl font-bold tracking-tight text-gray-900">Shop by Collection</h2>
<p class="mt-4 text-base text-gray-500">Each season, we collaborate with world-class designers to create a collection inspired by the natural world.</p>

<div class="mt-10 flow-root">
<div class="-my-2">
<div class="relative box-content h-80 overflow-x-auto py-2 xl:overflow-visible">
<div class="min-w-screen-xl absolute flex space-x-8 px-4 sm:px-6 lg:px-8 xl:relative xl:grid xl:grid-cols-5 xl:gap-x-8 xl:space-x-0 xl:px-0">
<a href="#" class="relative flex h-80 w-56 flex-col overflow-hidden rounded-lg p-6 hover:opacity-75 xl:w-auto">
<span aria-hidden="true" class="absolute inset-0">
<img src="{{ asset('assets/images/category-new-arrival.jpg') }}" alt=""
class="h-full w-full object-cover object-center">
</span>
<span aria-hidden="true"
class="absolute inset-x-0 bottom-0 h-2/3 bg-gradient-to-t from-gray-800 opacity-50"></span>
<span class="relative mt-auto text-center text-xl font-bold text-white">New Arrivals</span>
</a>
<a href="#" class="relative flex h-80 w-56 flex-col overflow-hidden rounded-lg p-6 hover:opacity-75 xl:w-auto">
<span aria-hidden="true" class="absolute inset-0">
<img src="{{ asset('assets/images/category-clothing.jpg') }}" alt=""
class="h-full w-full object-cover object-center">
</span>
<span aria-hidden="true"
class="absolute inset-x-0 bottom-0 h-2/3 bg-gradient-to-t from-gray-800 opacity-50"></span>
<span class="relative mt-auto text-center text-xl font-bold text-white">Clothing</span>
</a>
<a href="#" class="relative flex h-80 w-56 flex-col overflow-hidden rounded-lg p-6 hover:opacity-75 xl:w-auto">
<span aria-hidden="true" class="absolute inset-0">
<img src="{{ asset('assets/images/category-shoes.jpg') }}" alt=""
class="h-full w-full object-cover object-center">
</span>
<span aria-hidden="true"
class="absolute inset-x-0 bottom-0 h-2/3 bg-gradient-to-t from-gray-800 opacity-50"></span>
<span class="relative mt-auto text-center text-xl font-bold text-white">Shoes</span>
</a>
<a href="#" class="relative flex h-80 w-56 flex-col overflow-hidden rounded-lg p-6 hover:opacity-75 xl:w-auto">
<span aria-hidden="true" class="absolute inset-0">
<img src="{{ asset('assets/images/category-accessories.jpg') }}" alt=""
class="h-full w-full object-cover object-center">
</span>
<span aria-hidden="true"
class="absolute inset-x-0 bottom-0 h-2/3 bg-gradient-to-t from-gray-800 opacity-50"></span>
<span class="relative mt-auto text-center text-xl font-bold text-white">Accessories</span>
</a>
<a href="#" class="relative flex h-80 w-56 flex-col overflow-hidden rounded-lg p-6 hover:opacity-75 xl:w-auto">
<span aria-hidden="true" class="absolute inset-0">
<img src="{{ asset('assets/images/category-sale.jpg') }}" alt=""
class="h-full w-full object-cover object-center">
</span>
<span aria-hidden="true"
class="absolute inset-x-0 bottom-0 h-2/3 bg-gradient-to-t from-gray-800 opacity-50"></span>
<span class="relative mt-auto text-center text-xl font-bold text-white">Sale</span>
</a>
</div>
</div>
</div>
</div>

<div class="mt-6 sm:hidden">
<a href="#" class="block text-sm font-semibold text-gray-600 hover:text-gray-500">
Browse all categories
<span aria-hidden="true"> →</span>
</a>
</div>
</div>
</x-frontend.app>
Loading

0 comments on commit 68928e9

Please sign in to comment.