Skip to content

Commit d3d9266

Browse files
committed
layout in progress
1 parent 016627e commit d3d9266

File tree

9 files changed

+292
-19
lines changed

9 files changed

+292
-19
lines changed

laravel-backend/app/Providers/AppServiceProvider.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace App\Providers;
44

5+
use App\View\Components\AvoRedHeader;
6+
use Illuminate\Support\Facades\Blade;
57
use Illuminate\Support\ServiceProvider;
68

79
class AppServiceProvider extends ServiceProvider
@@ -23,6 +25,6 @@ public function register()
2325
*/
2426
public function boot()
2527
{
26-
//
28+
Blade::component('header', AvoRedHeader::class);
2729
}
2830
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace App\View\Components;
4+
5+
use AvoRed\Framework\AvoRed\AvoRed;
6+
use AvoRed\Framework\Database\Contracts\CategoryModelInterface;
7+
use Illuminate\View\Component;
8+
9+
class AvoRedFooter extends Component
10+
{
11+
public $categories;
12+
public function __construct()
13+
{
14+
$this->categories = AvoRed::repository(CategoryModelInterface::class)->all();
15+
}
16+
17+
/**
18+
* Get the view / contents that represent the component.
19+
*
20+
* @return \Illuminate\Contracts\View\View|\Closure|string
21+
*/
22+
public function render()
23+
{
24+
return view('components.avored-footer');
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace App\View\Components;
4+
5+
use AvoRed\Framework\AvoRed\AvoRed;
6+
use AvoRed\Framework\Database\Contracts\CategoryModelInterface;
7+
use Illuminate\View\Component;
8+
9+
class AvoRedHeader extends Component
10+
{
11+
public $categories;
12+
public function __construct()
13+
{
14+
$this->categories = AvoRed::repository(CategoryModelInterface::class)->all();
15+
}
16+
17+
/**
18+
* Get the view / contents that represent the component.
19+
*
20+
* @return \Illuminate\Contracts\View\View|\Closure|string
21+
*/
22+
public function render()
23+
{
24+
return view('components.avored-header');
25+
}
26+
}

laravel-backend/lang/en/system.php

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
<?php
3+
4+
return [
5+
6+
/*
7+
|--------------------------------------------------------------------------
8+
| AvoRed Translation Lines
9+
|--------------------------------------------------------------------------
10+
|
11+
*/
12+
13+
'categories' => 'Categories',
14+
'avored' => 'AvoRed',
15+
'avored_ecommerce' => 'AvoRed E commerce',
16+
'avored_tagline' => 'Elegant AvoRed ecommerce made with Laravel',
17+
'signup_for_our_newsletter' => 'Signup for our newsletter',
18+
'notify_me' => 'Notify me',
19+
];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!doctype html>
2+
<html>
3+
4+
<head>
5+
<meta charset="utf-8">
6+
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
<link href="https://fonts.bunny.net/css2?family=Nunito:wght@400;600;700&display=swap" rel="stylesheet">
9+
10+
@vite('resources/css/app.css')
11+
</head>
12+
13+
<body class="antialiased bg-white">
14+
15+
<x-avored-header />
16+
{{ $slot }}
17+
@vite('resources/js/app.js')
18+
<x-avored-footer />
19+
</body>
20+
21+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
<div class="mt-12">
2+
<footer class="text-gray-600 border border-t body-font bg-white">
3+
<div
4+
class="
5+
container
6+
py-12
7+
mx-auto
8+
flex
9+
md:items-center
10+
lg:items-start
11+
w-full
12+
"
13+
>
14+
<div
15+
class="w-64 flex-shrink-0 md:mx-0 mx-auto text-center md:text-left"
16+
>
17+
<a
18+
class="
19+
flex
20+
title-font
21+
font-medium
22+
items-center
23+
md:justify-start
24+
justify-center
25+
"
26+
>
27+
<img class="w-10 h-10 p-2 bg-white rounded-full" src="{{ asset('vendor/avored/images/logo_only.svg') }}" alt="{{ __('system.avored_ecommerce') }}" />
28+
<span class="ml-3 text-xl ">{{ __('system.avored') }}</span>
29+
</a>
30+
<p class="mt-2 text-sm ">
31+
{{ __('system.avored_tagline') }}
32+
</p>
33+
</div>
34+
<div
35+
class="
36+
flex-grow flex flex-wrap
37+
md:pl-20
38+
-mb-10
39+
md:mt-0
40+
mt-10
41+
md:text-left
42+
text-center
43+
"
44+
>
45+
<div v-if="!fetching" class="lg:w-1/4 md:w-1/2 w-full px-4">
46+
<h2
47+
class="
48+
font-semibold
49+
tracking-widest
50+
text-md
51+
mb-3
52+
"
53+
>
54+
{{ __('system.categories') }}
55+
</h2>
56+
<nav class="list-none mb-10">
57+
@foreach ($categories as $category)
58+
<li>
59+
<a href="#" class="self-center hover:text-red-500">
60+
{{ $category->name }}
61+
</a>
62+
</li>
63+
@endforeach
64+
</nav>
65+
</div>
66+
<div class="lg:w-3/4 md:w-1/2 w-full px-4">
67+
<h5 class=" tracking-widest font-semibold">{{ __('system.signup_for_our_newsletter') }}</h5>
68+
<div class="mt-5 flex w-full">
69+
<div class="lg:w-2/4 md:w-3/4">
70+
<input
71+
v-model="subscriberEmail"
72+
:placeholder="t('system.enter_your_email_address')"
73+
type="email"
74+
class="w-full px-4 py-3 ring-gray-300 ring-1 focus:ring-red-500 focus:outline-none rounded shadow-sm appearance-none text-gray-700"
75+
/>
76+
</div>
77+
<button class="ml-3 px-4 py-3 ring-1 ring-red-500 shadow-lg text-white font-semibold bg-red-500 rounded-md ">
78+
{{ __('system.notify_me') }}
79+
</button>
80+
</div>
81+
</div>
82+
</div>
83+
</div>
84+
<div class="bg-red-500">
85+
<div
86+
class="
87+
container
88+
mx-auto
89+
py-4
90+
px-5
91+
flex flex-wrap flex-col
92+
sm:flex-row
93+
"
94+
>
95+
<p class="text-white text-sm text-center sm:text-left">
96+
&copy; {{ date('Y') }}
97+
<a
98+
href="https://www.avored.com/"
99+
rel="noopener noreferrer"
100+
class="ml-1"
101+
target="_blank"
102+
>&copy; {{ __('system.avored_ecommerce') }}</a
103+
>
104+
</p>
105+
<span
106+
class="
107+
inline-flex
108+
sm:ml-auto sm:mt-0
109+
mt-2
110+
justify-center
111+
sm:justify-start
112+
"
113+
>
114+
<a class="text-gray-200" href="https://www.facebook.com/avored" target="_blank">
115+
<svg
116+
fill="currentColor"
117+
stroke-linecap="round"
118+
stroke-linejoin="round"
119+
stroke-width="2"
120+
class="w-5 h-5"
121+
viewBox="0 0 24 24"
122+
>
123+
<path
124+
d="M18 2h-3a5 5 0 00-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 011-1h3z"
125+
></path>
126+
</svg>
127+
</a>
128+
<a class="ml-3 text-gray-200" href="https://twitter.com/avoredecommerce" target="_blank">
129+
<svg
130+
fill="currentColor"
131+
stroke-linecap="round"
132+
stroke-linejoin="round"
133+
stroke-width="2"
134+
class="w-5 h-5"
135+
viewBox="0 0 24 24"
136+
>
137+
<path
138+
d="M23 3a10.9 10.9 0 01-3.14 1.53 4.48 4.48 0 00-7.86 3v1A10.66 10.66 0 013 4s-4 9 5 13a11.64 11.64 0 01-7 2c9 5 20 0 20-11.5a4.5 4.5 0 00-.08-.83A7.72 7.72 0 0023 3z"
139+
></path>
140+
</svg>
141+
</a>
142+
<a class="ml-3 text-gray-200" href="https://linkedin.com/company/avored-e-commerce" target="_blank">
143+
<svg
144+
fill="currentColor"
145+
stroke="currentColor"
146+
stroke-linecap="round"
147+
stroke-linejoin="round"
148+
stroke-width="0"
149+
class="w-5 h-5"
150+
viewBox="0 0 24 24"
151+
>
152+
<path
153+
stroke="none"
154+
d="M16 8a6 6 0 016 6v7h-4v-7a2 2 0 00-2-2 2 2 0 00-2 2v7h-4v-7a6 6 0 016-6zM2 9h4v12H2z"
155+
></path>
156+
<circle cx="4" cy="4" r="2" stroke="none"></circle>
157+
</svg>
158+
</a>
159+
</span>
160+
</div>
161+
</div>
162+
</footer>
163+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<section class="bg-white shadow-md">
2+
<div class="container mx-auto">
3+
<nav class="justify-between">
4+
<div class="py-4 flex w-full items-center">
5+
6+
<a href="#" class="flex items-center">
7+
<img class="w-10" src="{{ asset('vendor/avored/images/logo_only.svg') }}" alt="{{ __('system.avored_ecommerce') }}" />
8+
<span class="text-2xl ml-3 text-red-700">
9+
{{ __('system.avored') }}
10+
</span>
11+
</a>
12+
<ul class="hidden ml-auto md:flex space-x-6">
13+
@foreach ($categories as $category)
14+
<li>
15+
<a href="#" class="self-center hover:text-red-500">
16+
{{ $category->name }}
17+
</a>
18+
</li>
19+
@endforeach
20+
</ul>
21+
</div>
22+
</nav>
23+
</div>
24+
</section>
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
1-
<!doctype html>
2-
<html>
3-
<head>
4-
<meta charset="utf-8">
5-
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<link href="https://fonts.bunny.net/css2?family=Nunito:wght@400;600;700&display=swap" rel="stylesheet">
8-
9-
@vite('resources/css/app.css')
10-
</head>
11-
<body class="antialiased bg-white">
12-
<div class="flex w-full h-screen items-center justify-center">
13-
<h1 class="text-3xl text-red-700 font-bold">
14-
AvoRed E commerce
15-
</h1>
1+
<x-app>
2+
<div class="container mx-auto mt-5">
3+
<div class="text-red-700 text-xl">
4+
{{ __('system.avored_ecommerce') }}
5+
</div>
166
</div>
17-
@vite('resources/js/app.js')
18-
</body>
19-
</html>
7+
</x-app>

laravel-backend/routes/web.php

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?php
22

3+
use AvoRed\Framework\AvoRed\AvoRed;
4+
use AvoRed\Framework\Database\Contracts\CategoryModelInterface;
5+
use AvoRed\Framework\Database\Models\Category;
36
use Illuminate\Support\Facades\Route;
47

58
/*
@@ -14,5 +17,6 @@
1417
*/
1518

1619
Route::get('/', function () {
20+
1721
return view('welcome');
1822
});

0 commit comments

Comments
 (0)