Commit d2e0d4fcb2a764dec8c90a24ac303007141f017a
1 parent
242debab88
Exists in
master
Добавление миграции партнеры, создание новостей на главной странице, создание де…
…тальной страницы новости
Showing 14 changed files with 412 additions and 38 deletions Side-by-side Diff
- app/Classes/RusDate.php
- app/Http/Controllers/MainController.php
- app/Models/Partners.php
- database/migrations/2023_03_03_062929_create_partners_table.php
- database/seeders/DatabaseSeeder.php
- database/seeders/PartnersTableSeeder.php
- resources/views/catalogs/elemhouse.blade.php
- resources/views/catalogs/new.blade.php
- resources/views/cookies.blade.php
- resources/views/house/post.blade.php
- resources/views/index.blade.php
- resources/views/layout/site.blade.php
- resources/views/new/post.blade.php
- routes/web.php
app/Classes/RusDate.php
... | ... | @@ -0,0 +1,47 @@ |
1 | +<?php | |
2 | + | |
3 | + | |
4 | +namespace App\Classes; | |
5 | + | |
6 | + | |
7 | +class RusDate | |
8 | +{ | |
9 | + public static function russian_date($date = null){ | |
10 | + $date=explode(".", date("d.m.Y")); | |
11 | + $m = ""; | |
12 | + | |
13 | + switch ($date[1]){ | |
14 | + case 1: $m = 'января'; break; | |
15 | + case 2: $m = 'февраля'; break; | |
16 | + case 3: $m = 'марта'; break; | |
17 | + case 4: $m = 'апреля'; break; | |
18 | + case 5: $m = 'мая'; break; | |
19 | + case 6: $m = 'июня'; break; | |
20 | + case 7: $m = 'июля'; break; | |
21 | + case 8: $m = 'августа'; break; | |
22 | + case 9: $m = 'сентября'; break; | |
23 | + case 10: $m = 'октября'; break; | |
24 | + case 11: $m = 'ноября'; break; | |
25 | + case 12: $m = 'декабря'; break; | |
26 | + } | |
27 | + return $date[0].' '.$m.' '.$date[2]; | |
28 | + } | |
29 | + | |
30 | + public static function russian_month($month) { | |
31 | + switch ($month){ | |
32 | + case 1: $m = 'января'; break; | |
33 | + case 2: $m = 'февраля'; break; | |
34 | + case 3: $m = 'марта'; break; | |
35 | + case 4: $m = 'апреля'; break; | |
36 | + case 5: $m = 'мая'; break; | |
37 | + case 6: $m = 'июня'; break; | |
38 | + case 7: $m = 'июля'; break; | |
39 | + case 8: $m = 'августа'; break; | |
40 | + case 9: $m = 'сентября'; break; | |
41 | + case 10: $m = 'октября'; break; | |
42 | + case 11: $m = 'ноября'; break; | |
43 | + case 12: $m = 'декабря'; break; | |
44 | + } | |
45 | + return $m; | |
46 | + } | |
47 | +} |
app/Http/Controllers/MainController.php
... | ... | @@ -4,7 +4,9 @@ namespace App\Http\Controllers; |
4 | 4 | |
5 | 5 | use App\Models\House; |
6 | 6 | use App\Models\News; |
7 | +use App\Models\Partners; | |
7 | 8 | use Illuminate\Http\Request; |
9 | +use App\Classes\RusDate; | |
8 | 10 | |
9 | 11 | class MainController extends Controller |
10 | 12 | { |
... | ... | @@ -12,9 +14,10 @@ class MainController extends Controller |
12 | 14 | * Главная страница проекта |
13 | 15 | */ |
14 | 16 | public function index() { |
15 | - $houses = House::with('areas')->orderBy('created_at')->limit(8)->get(); | |
16 | - $news = News::query()->orderByDesc('created_at')->limit(8); | |
17 | - return view('index', compact('houses', 'news')); | |
17 | + $houses = House::with('areas')->orderByDesc('created_at')->limit(8)->get(); | |
18 | + $news = News::query()->orderByDesc('created_at')->limit(8)->get(); | |
19 | + $partners = Partners::query()->limit(18)->get(); | |
20 | + return view('index', compact('houses', 'news', 'partners')); | |
18 | 21 | } |
19 | 22 | |
20 | 23 | /* |
... | ... | @@ -58,4 +61,19 @@ class MainController extends Controller |
58 | 61 | public function MapsObj() { |
59 | 62 | return view('mapsobj'); |
60 | 63 | } |
64 | + | |
65 | + /* | |
66 | + * Посмотр конктретного предложение офиса | |
67 | + */ | |
68 | + public function Offer(House $house) { | |
69 | + return view('house.post', compact('house')); | |
70 | + } | |
71 | + | |
72 | + /* | |
73 | + * Просмотр детально конкретной новости | |
74 | + */ | |
75 | + public function DetailNew(News $news) { | |
76 | + $news_list = News::query()->orderByDesc('created_at')->limit(8)->get(); | |
77 | + return view('new.post', compact('news', 'news_list')); | |
78 | + } | |
61 | 79 | } |
app/Models/Partners.php
database/migrations/2023_03_03_062929_create_partners_table.php
... | ... | @@ -0,0 +1,33 @@ |
1 | +<?php | |
2 | + | |
3 | +use Illuminate\Database\Migrations\Migration; | |
4 | +use Illuminate\Database\Schema\Blueprint; | |
5 | +use Illuminate\Support\Facades\Schema; | |
6 | + | |
7 | +return new class extends Migration | |
8 | +{ | |
9 | + /** | |
10 | + * Run the migrations. | |
11 | + * | |
12 | + * @return void | |
13 | + */ | |
14 | + public function up() | |
15 | + { | |
16 | + Schema::create('partners', function (Blueprint $table) { | |
17 | + $table->id(); | |
18 | + $table->string('name', 255); | |
19 | + $table->string('foto', 255)->nullable(); | |
20 | + $table->timestamps(); | |
21 | + }); | |
22 | + } | |
23 | + | |
24 | + /** | |
25 | + * Reverse the migrations. | |
26 | + * | |
27 | + * @return void | |
28 | + */ | |
29 | + public function down() | |
30 | + { | |
31 | + Schema::dropIfExists('partners'); | |
32 | + } | |
33 | +}; |
database/seeders/DatabaseSeeder.php
... | ... | @@ -39,5 +39,8 @@ class DatabaseSeeder extends Seeder |
39 | 39 | $this->call(ContactsTableSeeder::class); |
40 | 40 | $this->command->info('Таблица контакты загружена!!'); |
41 | 41 | |
42 | + $this->call(PartnersTableSeeder::class); | |
43 | + $this->command->info('Таблица партнеры загружена!!'); | |
44 | + | |
42 | 45 | } |
43 | 46 | } |
database/seeders/PartnersTableSeeder.php
... | ... | @@ -0,0 +1,109 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace Database\Seeders; | |
4 | + | |
5 | +use App\Models\Partners; | |
6 | +use Illuminate\Database\Console\Seeds\WithoutModelEvents; | |
7 | +use Illuminate\Database\Eloquent\Model; | |
8 | +use Illuminate\Database\Seeder; | |
9 | + | |
10 | +class PartnersTableSeeder extends Seeder | |
11 | +{ | |
12 | + /** | |
13 | + * Run the database seeds. | |
14 | + * | |
15 | + * @return void | |
16 | + */ | |
17 | + public function run() | |
18 | + { | |
19 | + $data = [ | |
20 | + /*1 */[ | |
21 | + 'name' => 'Сбербанк', | |
22 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
23 | + ], | |
24 | + /*2*/[ | |
25 | + 'name' => 'Росбанк2', | |
26 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
27 | + ], | |
28 | + /*3*/[ | |
29 | + 'name' => 'Ренесансбанк3', | |
30 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
31 | + ], | |
32 | + /*4*/[ | |
33 | + 'name' => 'Тиньковбанк4', | |
34 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
35 | + ], | |
36 | + /*5*/[ | |
37 | + 'name' => 'Летобанк5', | |
38 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
39 | + ], | |
40 | + /*6*/[ | |
41 | + 'name' => 'Хоумкредитбанк6', | |
42 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
43 | + ], | |
44 | + /*7*/[ | |
45 | + 'name' => 'Сбербанк7', | |
46 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
47 | + ], | |
48 | + /*8*/[ | |
49 | + 'name' => 'Сбербанк8', | |
50 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
51 | + ], | |
52 | + /*9*/[ | |
53 | + 'name' => 'Сбербанк9', | |
54 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
55 | + ], | |
56 | + /*10*/[ | |
57 | + 'name' => 'Сбербанк10', | |
58 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
59 | + ], | |
60 | + /*11*/[ | |
61 | + 'name' => 'Сбербанк11', | |
62 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
63 | + ], | |
64 | + /*12*/[ | |
65 | + 'name' => 'Сбербанк12', | |
66 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
67 | + ], | |
68 | + /*13*/[ | |
69 | + 'name' => 'Сбербанк13', | |
70 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
71 | + ], | |
72 | + /*14*/[ | |
73 | + 'name' => 'Сбербанк14', | |
74 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
75 | + ], | |
76 | + /*15*/[ | |
77 | + 'name' => 'Сбербанк15', | |
78 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
79 | + ], | |
80 | + /*16*/[ | |
81 | + 'name' => 'Сбербанк16', | |
82 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
83 | + ], | |
84 | + /*17*/[ | |
85 | + 'name' => 'Сбербанк17', | |
86 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
87 | + ], | |
88 | + /*18*/[ | |
89 | + 'name' => 'Сбербанк18', | |
90 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
91 | + ], | |
92 | + /*19*/[ | |
93 | + 'name' => 'Сбербанк19', | |
94 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
95 | + ], | |
96 | + /*20*/[ | |
97 | + 'name' => 'Сбербанк20', | |
98 | + 'foto' => 'images/partners/partners-item-img-3.png' | |
99 | + ], | |
100 | + ]; | |
101 | + | |
102 | + foreach ($data as $item) { | |
103 | + $albom = new Partners(); | |
104 | + $albom->name = $item['name']; | |
105 | + $albom->foto = $item['foto']; | |
106 | + $albom->save(); | |
107 | + } | |
108 | + } | |
109 | +} |
resources/views/catalogs/elemhouse.blade.php
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 | } |
34 | 34 | ?> |
35 | 35 | <div class="card__price"><span>{{ $price }} ₽ </span><? echo $comment; ?> |
36 | - </div><a class="card__btn btn btn--bordered" href="#">Подробнее</a> | |
36 | + </div><a class="card__btn btn btn--bordered" href="{{ route('offer', ['house' => $house->id]) }}">Подробнее</a> | |
37 | 37 | </div> |
38 | 38 | </div> |
39 | 39 | </div> |
resources/views/catalogs/new.blade.php
... | ... | @@ -0,0 +1,13 @@ |
1 | +<div class="swiper-slide"> | |
2 | + <div class="card-news"> | |
3 | + <div class="card-news__top"><img src="{{ asset($new->foto) }}" alt="{{ $new->title }}" loading="lazy"> | |
4 | + <div class="card-news__date"><span>{{ $new->created_at->format('d') }}</span><span>{{ \App\Classes\RusDate::russian_month($new->created_at->format('m')) }} {{$new->created_at->format('Y')}}</span></div> | |
5 | + </div> | |
6 | + <div class="card-news__cnt"> | |
7 | + <p class="card-news__descr">{{ $new->title }}</p><a class="card-news__link" href="{{ route('new', ['news' => $new->id]) }}">Подробнее | |
8 | + <svg width="17" height="12"> | |
9 | + <use xlink:href="{{ asset('images/sprite.svg#card-news-link-arrow') }}"></use> | |
10 | + </svg></a> | |
11 | + </div> | |
12 | + </div> | |
13 | +</div> |
resources/views/cookies.blade.php
... | ... | @@ -0,0 +1,42 @@ |
1 | +@extends('layout.site', ['title' => 'Избранное RentTorg']) | |
2 | + | |
3 | +@section('content') | |
4 | + <section class="favorites"> | |
5 | + <div class="favorites-top"> | |
6 | + <div class="container"> | |
7 | + <div class="breadcrumbs"> | |
8 | + <ul class="breadcrumbs__list"> | |
9 | + <li class="breadcrumbs__item"><a class="breadcrumbs__link" href="#">Главная</a></li> | |
10 | + <li class="breadcrumbs__item"><span class="breadcrumbs__link">Избранное </span></li> | |
11 | + </ul> | |
12 | + </div> | |
13 | + <h1 class="favorites__title title-main">Тут пока что ничего нет...</h1><a class="favorites-top__link" href="#">Выберите идеальную недвижимость </a> | |
14 | + <p class="favorites__descr">Здесь вы можете ознакомиться с недвижимостью которая вам понравилось</p> | |
15 | + </div> | |
16 | + </div> | |
17 | + <div class="favorites-cnt"> | |
18 | + <div class="container"> | |
19 | + <div class="favorites__items"> | |
20 | + <div class="favorites-item"> | |
21 | + <div class="favorites-item__img"><img src="images/favorites/favorites-item-img-1.svg" alt=""></div> | |
22 | + <p class="favorites-item__descr"><a href="#">Найдите</a> идеальную планировку на сайте Renttorg</p> | |
23 | + </div> | |
24 | + <div class="favorites-item"> | |
25 | + <div class="favorites-item__img"><img src="images/favorites/favorites-item-img-2.svg" alt=""></div> | |
26 | + <p class="favorites-item__descr">Нажмите на <img src="images/favorites-icon-mini.svg" alt=""> для добавления недвижемости в избранное</p> | |
27 | + </div> | |
28 | + <div class="favorites-item"> | |
29 | + <div class="favorites-item__img"><img src="images/favorites/favorites-item-img-3.svg" alt=""></div> | |
30 | + <p class="favorites-item__descr">Перейдите в избранное или сравнение для выбора планировки</p> | |
31 | + </div> | |
32 | + </div> | |
33 | + </div> | |
34 | + </div> | |
35 | + </section> | |
36 | +@endsection | |
37 | + | |
38 | +@section('form_feedback') | |
39 | + <!-- Форма обратной связи --> | |
40 | + @include('form.form_feedback') | |
41 | +@endsection | |
42 | + |
resources/views/house/post.blade.php
... | ... | @@ -0,0 +1 @@ |
1 | +<?php |
resources/views/index.blade.php
... | ... | @@ -295,39 +295,29 @@ |
295 | 295 | </div> |
296 | 296 | </section> |
297 | 297 | <!-- Партнеры --> |
298 | - <section class="partners"> | |
298 | + | |
299 | + @if ($partners->count()) | |
300 | + <section class="partners"> | |
299 | 301 | <div class="container"> |
300 | 302 | <h2 class="partners__title title">Партнеры нашей компании</h2> |
301 | 303 | <div class="partners__swiper swiper" data-mobile="false"> |
302 | 304 | <div class="swiper-wrapper"> |
303 | 305 | <div class="swiper-slide"> |
304 | 306 | <div class="partners__inner"> |
305 | - <div class="partners-item"><img src="images/partners/partners-item-img-3.png" alt="Лого партнера" loading="lazy"></div> | |
306 | - <div class="partners-item"><img src="images/partners/partners-item-img-3.png" alt="Лого партнера" loading="lazy"></div> | |
307 | - <div class="partners-item"><img src="images/partners/partners-item-img-3.png" alt="Лого партнера" loading="lazy"></div> | |
308 | - <div class="partners-item"><img src="images/partners/partners-item-img-3.png" alt="Лого партнера" loading="lazy"></div> | |
309 | - <div class="partners-item"><img src="images/partners/partners-item-img-3.png" alt="Лого партнера" loading="lazy"></div> | |
310 | - <div class="partners-item"><img src="images/partners/partners-item-img-3.png" alt="Лого партнера" loading="lazy"></div> | |
311 | - <div class="partners-item"><img src="images/partners/partners-item-img-3.png" alt="Лого партнера" loading="lazy"></div> | |
312 | - <div class="partners-item"><img src="images/partners/partners-item-img-3.png" alt="Лого партнера" loading="lazy"></div> | |
313 | - <div class="partners-item"><img src="images/partners/partners-item-img-3.png" alt="Лого партнера" loading="lazy"></div> | |
314 | - <div class="partners-item"><img src="images/partners/partners-item-img-3.png" alt="Лого партнера" loading="lazy"></div> | |
315 | - <div class="partners-item"><img src="images/partners/partners-item-img-3.png" alt="Лого партнера" loading="lazy"></div> | |
316 | - <div class="partners-item"><img src="images/partners/partners-item-img-3.png" alt="Лого партнера" loading="lazy"></div> | |
317 | - <div class="partners-item"><img src="images/partners/partners-item-img-3.png" alt="Лого партнера" loading="lazy"></div> | |
318 | - <div class="partners-item"><img src="images/partners/partners-item-img-3.png" alt="Лого партнера" loading="lazy"></div> | |
319 | - <div class="partners-item"><img src="images/partners/partners-item-img-3.png" alt="Лого партнера" loading="lazy"></div> | |
320 | - <div class="partners-item"><img src="images/partners/partners-item-img-3.png" alt="Лого партнера" loading="lazy"></div> | |
321 | - <div class="partners-item"><img src="images/partners/partners-item-img-3.png" alt="Лого партнера" loading="lazy"></div> | |
322 | - <div class="partners-item"><img src="images/partners/partners-item-img-3.png" alt="Лого партнера" loading="lazy"></div> | |
307 | + @foreach ($partners as $partner) | |
308 | + <div class="partners-item"><img src="{{ $partner->foto }}" alt="{{ $partner->name }}" loading="lazy"></div> | |
309 | + @endforeach | |
310 | + | |
323 | 311 | </div> |
324 | 312 | </div> |
325 | 313 | </div> |
326 | 314 | <div class="swiper-scrollbar"></div> |
327 | 315 | </div> |
328 | 316 | </div> |
329 | - </section> | |
317 | + </section> | |
318 | + @endif | |
330 | 319 | <!-- Новости --> |
320 | + | |
331 | 321 | <section class="slider"> |
332 | 322 | <div class="container"> |
333 | 323 | <div class="slider__wrap"> |
... | ... | @@ -348,7 +338,16 @@ |
348 | 338 | </div> |
349 | 339 | <div class="slider__swiper swiper"> |
350 | 340 | <div class="swiper-wrapper"> |
351 | - <div class="swiper-slide"> | |
341 | + @if ($news->count()) | |
342 | + @foreach($news as $new) | |
343 | + @include('catalogs.new', ['new' => $new]) | |
344 | + @endforeach | |
345 | + @else | |
346 | + <h3>Пока здесь нет новостей!</h3> | |
347 | + @endif | |
348 | + | |
349 | + | |
350 | + <!--<div class="swiper-slide"> | |
352 | 351 | <div class="card-news"> |
353 | 352 | <div class="card-news__top"><img src="images/card/card-img-5.jpg" alt="Превью к новости" loading="lazy"> |
354 | 353 | <div class="card-news__date"><span>15</span><span>Декабря 2022</span></div> |
... | ... | @@ -451,7 +450,7 @@ |
451 | 450 | </svg></a> |
452 | 451 | </div> |
453 | 452 | </div> |
454 | - </div> | |
453 | + </div>--> | |
455 | 454 | </div> |
456 | 455 | </div> |
457 | 456 | <div class="swiper-pagination"></div> |
resources/views/layout/site.blade.php
... | ... | @@ -20,7 +20,7 @@ |
20 | 20 | <div class="wrapper"> |
21 | 21 | <header class="header js_header"> |
22 | 22 | <div class="container"> |
23 | - <div class="header__wrap"><a class="header__logo" href="{{ route('index') }}"><img src="images/logo.svg" alt="Лого"></a> | |
23 | + <div class="header__wrap"><a class="header__logo" href="{{ route('index') }}"><img src="{{ asset('images/logo.svg') }}" alt="Лого"></a> | |
24 | 24 | <nav class="header__nav nav"> |
25 | 25 | <ul class="nav__list"> |
26 | 26 | <li class="nav__item"><a class="nav__link" href="{{ route('catalog') }}">Каталог</a></li> |
... | ... | @@ -31,7 +31,7 @@ |
31 | 31 | </nav> |
32 | 32 | <div class="header__buttons"><a class="header__btn-phone" href="#" data-btn="feedback"> |
33 | 33 | <svg width="22" height="22"> |
34 | - <use xlink:href="images/sprite.svg#header-btn-phone"></use> | |
34 | + <use xlink:href="{{ asset('images/sprite.svg#header-btn-phone') }}"></use> | |
35 | 35 | </svg></a> |
36 | 36 | <div class="header__contacts"> |
37 | 37 | <div class="header__col"><a class="header__contact" href="mailto:{{ $items_contact[0]->email }}">{{ $items_contact[0]->email }}</a></div> |
... | ... | @@ -41,7 +41,7 @@ |
41 | 41 | </div> |
42 | 42 | <button class="header__burger js_header_burger" type="button">Меню |
43 | 43 | <svg width="28" height="18"> |
44 | - <use xlink:href="images/sprite.svg#burger"></use> | |
44 | + <use xlink:href="{{ asset('images/sprite.svg#burger') }}"></use> | |
45 | 45 | </svg> |
46 | 46 | </button> |
47 | 47 | </div> |
... | ... | @@ -49,7 +49,7 @@ |
49 | 49 | <div class="menu__wrap"> |
50 | 50 | <button class="menu__close js_menu_close" type="button">Меню |
51 | 51 | <svg width="20" height="20"> |
52 | - <use xlink:href="images/sprite.svg#popup-close"></use> | |
52 | + <use xlink:href="{{ asset('images/sprite.svg#popup-close') }}"></use> | |
53 | 53 | </svg> |
54 | 54 | </button> |
55 | 55 | <div class="menu__inner"> |
... | ... | @@ -68,7 +68,7 @@ |
68 | 68 | <li class="social__item"><a class="social__link" href="#" target="_blank"><img src="images/tg.svg" alt=""></a></li> |
69 | 69 | <li class="social__item"><a class="social__link" href="#" target="_blank"> |
70 | 70 | <svg width="40" height="40"> |
71 | - <use xlink:href="images/sprite.svg#wa"></use> | |
71 | + <use xlink:href="{{ asset('images/sprite.svg#wa')}}"></use> | |
72 | 72 | </svg></a></li> |
73 | 73 | </ul> |
74 | 74 | </div> |
... | ... | @@ -87,16 +87,16 @@ |
87 | 87 | |
88 | 88 | </main> |
89 | 89 | |
90 | - <footer class="footer" style="background-image:url('images/footer-bg.jpg')"> | |
90 | + <footer class="footer" style="background-image:url({{ asset('images/footer-bg.jpg')}})"> | |
91 | 91 | <div class="footer__buttons"> |
92 | 92 | <button class="footer__btn footer__btn-phone js_btn_contact_us" type="button"> |
93 | 93 | <svg width="30" height="32"> |
94 | - <use xlink:href="images/sprite.svg#footer-btn-phone"></use> | |
94 | + <use xlink:href="{{ asset('images/sprite.svg#footer-btn-phone')}}"></use> | |
95 | 95 | </svg> |
96 | 96 | </button> |
97 | 97 | <button class="footer__btn footer__btn-up js_btn_up" type="button"> |
98 | 98 | <svg width="19" height="11"> |
99 | - <use xlink:href="images/sprite.svg#footer-btn-up"></use> | |
99 | + <use xlink:href="{{ asset('images/sprite.svg#footer-btn-up')}}"></use> | |
100 | 100 | </svg> |
101 | 101 | </button> |
102 | 102 | </div> |
... | ... | @@ -107,7 +107,7 @@ |
107 | 107 | <div class="footer-middle"> |
108 | 108 | <div class="container"> |
109 | 109 | <div class="footer-middle__wrap"> |
110 | - <div class="footer__col footer__col-intro"><a class="footer__logo" href="index.html"><img src="images/logo-footer.svg" alt="Лого"></a> | |
110 | + <div class="footer__col footer__col-intro"><a class="footer__logo" href="index.html"><img src="{{ asset('images/logo-footer.svg')}}" alt="Лого"></a> | |
111 | 111 | <p class="footer__descr">В группу “Renttorg” входит ряд ведущих российских девелоперских компаний полного цикла, реализующих масштабные объекты недвижимости.</p> |
112 | 112 | <div class="footer-questions"> |
113 | 113 | <h3 class="footer-questions__title">Есть вопросы или предложения?</h3><a class="footer-questions__btn btn btn--main" href="#" data-btn="feedback">Напишите нам</a> |
... | ... | @@ -124,7 +124,7 @@ |
124 | 124 | <li class="footer__item"><a class="footer__link" href="{{ route('news') }}">Новости</a></li> |
125 | 125 | </ul> |
126 | 126 | |
127 | - </div><a class="footer__author" href="#" target="_blank"><img src="images/author.png" alt="Лого разработчика"></a> | |
127 | + </div><a class="footer__author" href="#" target="_blank"><img src="{{ asset('images/author.png')}}" alt="Лого разработчика"></a> | |
128 | 128 | </div> |
129 | 129 | <div class="footer__col js_footer_col"> |
130 | 130 | <h3 class="footer__caption js_footer_caption">Услуги</h3> |
... | ... | @@ -155,10 +155,10 @@ |
155 | 155 | </ul> |
156 | 156 | <div class="footer__social social"> |
157 | 157 | <ul class="social__list"> |
158 | - <li class="social__item"><a class="social__link" href="#" target="_blank"><img src="images/tg.svg" alt=""></a></li> | |
158 | + <li class="social__item"><a class="social__link" href="#" target="_blank"><img src="{{ asset('images/tg.svg')}}" alt=""></a></li> | |
159 | 159 | <li class="social__item"><a class="social__link" href="#" target="_blank"> |
160 | 160 | <svg width="40" height="40"> |
161 | - <use xlink:href="images/sprite.svg#wa"></use> | |
161 | + <use xlink:href="{{ asset('images/sprite.svg#wa') }}"></use> | |
162 | 162 | </svg></a></li> |
163 | 163 | </ul> |
164 | 164 | </div> |
resources/views/new/post.blade.php
... | ... | @@ -0,0 +1,92 @@ |
1 | +@extends('layout.site', ['title' => $news->title ]) | |
2 | + | |
3 | +@section('content') | |
4 | + <section class="news-one"> | |
5 | + <div class="news-one-top" style=" | |
6 | + @if ($news->foto) | |
7 | + background-image:url({{ asset($news->foto)}}) | |
8 | + @else | |
9 | + background-image:url({{ asset('images/news-one-bg.jpg')}}) | |
10 | + @endif | |
11 | + | |
12 | + "> | |
13 | + <div class="container"> | |
14 | + <div class="news-one-top__wrap"> | |
15 | + <div class="breadcrumbs"> | |
16 | + <ul class="breadcrumbs__list"> | |
17 | + <li class="breadcrumbs__item"><a class="breadcrumbs__link" href="{{ route('index') }}">Главная</a></li> | |
18 | + <li class="breadcrumbs__item"><a class="breadcrumbs__link" href="{{ route('news') }}">Новости</a></li> | |
19 | + <li class="breadcrumbs__item"><span class="breadcrumbs__link">{{ $news->title }}</span></li> | |
20 | + </ul> | |
21 | + </div> | |
22 | + <h1 class="news-one__title title-main">{{ $news->title }}</h1> | |
23 | + <div class="news-one__date"><span>{{ $news->created_at->format('d') }}</span><span>{{ \App\Classes\RusDate::russian_month($news->created_at->format('m')) }} {{$news->created_at->format('Y')}}</span></div> | |
24 | + </div> | |
25 | + </div> | |
26 | + </div> | |
27 | + <div class="container"> | |
28 | + <div class="news-one__inner"> | |
29 | + <div class="news-one__social social"> | |
30 | + <div class="social__title">Поделиться новостью:</div> | |
31 | + <ul class="social__list"> | |
32 | + <li class="social__item"><a class="social__link" href="#" target="_blank"><img src="{{ asset('images/tg.svg') }}" alt=""></a></li> | |
33 | + <li class="social__item"><a class="social__link" href="#" target="_blank"> | |
34 | + <svg width="40" height="40"> | |
35 | + <use xlink:href="{{ asset('images/sprite.svg#wa')}}"></use> | |
36 | + </svg></a></li> | |
37 | + <li class="social__item"><a class="social__link" href="#" target="_blank"> | |
38 | + <svg width="40" height="40"> | |
39 | + <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> | |
40 | + </svg></a></li> | |
41 | + <li class="social__item"><a class="social__link" href="#" target="_blank"> | |
42 | + <svg width="40" height="40"> | |
43 | + <use xlink:href="{{ asset('images/sprite.svg#fb')}}"></use> | |
44 | + </svg></a></li> | |
45 | + </ul> | |
46 | + </div> | |
47 | + <div class="news-one__descr"> | |
48 | + {{ $news->text }} | |
49 | + </div> | |
50 | + </div> | |
51 | + </div> | |
52 | + </section> | |
53 | + <section class="slider"> | |
54 | + <div class="container"> | |
55 | + <div class="slider__wrap"> | |
56 | + <div class="slider__top"> | |
57 | + <h2 class="slider__title title">Последние новости</h2> | |
58 | + <div class="slider__control"> | |
59 | + <div class="swiper-button-prev"> | |
60 | + <svg width="10" height="17"> | |
61 | + <use xlink:href="{{ asset('images/sprite.svg#slider-arrow')}}"></use> | |
62 | + </svg> | |
63 | + </div> | |
64 | + <div class="swiper-button-next"> | |
65 | + <svg width="10" height="17"> | |
66 | + <use xlink:href="{{ asset('images/sprite.svg#slider-arrow')}}"></use> | |
67 | + </svg> | |
68 | + </div> | |
69 | + </div> | |
70 | + </div> | |
71 | + <div class="slider__swiper swiper"> | |
72 | + <div class="swiper-wrapper"> | |
73 | + @if ($news_list->count()) | |
74 | + @foreach($news_list as $new) | |
75 | + @include('catalogs.new', ['new' => $new]) | |
76 | + @endforeach | |
77 | + @else | |
78 | + <h3>Пока здесь нет новостей!</h3> | |
79 | + @endif | |
80 | + | |
81 | + </div> | |
82 | + </div> | |
83 | + <div class="swiper-pagination"></div> | |
84 | + </div> | |
85 | + </div> | |
86 | + </section> | |
87 | +@endsection | |
88 | + | |
89 | +@section('form_feedback') | |
90 | + <!-- Форма обратной связи --> | |
91 | + @include('form.form_feedback') | |
92 | +@endsection |
routes/web.php
... | ... | @@ -38,3 +38,9 @@ Route::get('maps',[MainController::class, 'mapsobj'])->name('maps'); |
38 | 38 | Route::get('conf', function () { |
39 | 39 | return view('conf'); |
40 | 40 | })->name('conf'); |
41 | + | |
42 | +//Детальная страница предложения недвижимости | |
43 | +Route::get('offer/{house:id}', [MainController::class, 'offer'])->name('offer'); | |
44 | + | |
45 | +//Детальная страница новостей | |
46 | +Route::get('detail-new/{news:id}', [MainController::class, 'DetailNew'])->name('new'); |