Skip to content

Commit

Permalink
Web > Social media kayıtları gösterildi.
Browse files Browse the repository at this point in the history
  • Loading branch information
berkanumutlu committed Jul 9, 2024
1 parent ae10400 commit 320ff07
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 52 deletions.
48 changes: 29 additions & 19 deletions db/laravel_voyager.sql

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion project/app/Http/Controllers/Web/ArticleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,17 @@ public function show(\TCG\Voyager\Models\Post $post)
});
return $records;
});
$social_media_list = \App\Models\SocialMedia::query()->where('status', 1)
->select(['name', 'icon', 'link', 'description'])
->orderBy('sort', 'asc')->get();
$title = $record->seo_title ?? $record->title;
$meta_description = $record->meta_description;
$meta_keywords = $record->meta_keywords;
return view('web.article.detail',
compact(['title', 'meta_description', 'meta_keywords', 'record', 'last_records', 'category_list']));
compact([
'title', 'meta_description', 'meta_keywords', 'record', 'last_records', 'category_list',
'social_media_list'
]));
}

public function show_article_page()
Expand Down
2 changes: 1 addition & 1 deletion project/app/Http/Controllers/Web/ContactController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function message(Request $request)
];
ContactMessage::insert($data);
Mail::send(new SendContactMessageMail($data));
return redirect()->route('contact.index')->with('success', 'Success Message')->exceptInput('token');
return redirect()->route('contact.index')->with('success', 'Success Message');
} catch (\Exception $e) {
//TODO: Hata log düşülebilir.
return redirect()->route('contact.index')->with('error', 'Error Message')->exceptInput('token');
Expand Down
8 changes: 7 additions & 1 deletion project/app/Http/Controllers/Web/NewsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,16 @@ public function show(News $news)
});
return $records;
});
$social_media_list = \App\Models\SocialMedia::query()->where('status', 1)
->select(['name', 'icon', 'link', 'description'])
->orderBy('sort', 'asc')->get();
$title = $record->seo_title ?? $record->title;
$meta_description = $record->meta_description;
$meta_keywords = $record->meta_keywords;
return view('web.news.detail',
compact(['title', 'meta_description', 'meta_keywords', 'record', 'last_records', 'category_list']));
compact([
'title', 'meta_description', 'meta_keywords', 'record', 'last_records', 'category_list',
'social_media_list'
]));
}
}
6 changes: 5 additions & 1 deletion project/app/Providers/WebServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ public function boot(): void
{
if (!request()->fullUrlIs('*admin*') && !request()->fullUrlIs('*api*')) {
View::composer(['layouts.web'], function ($view) {
$social_media_list = \App\Models\SocialMedia::query()->where('status', 1)
->select(['name', 'icon', 'link', 'description'])
->orderBy('sort', 'asc')->get();
$view->with([
'site_name' => setting('site.title'),
'site_slogan' => setting('site.description'),
'site_logo' => asset('storage/'.setting('site.logo')),
'site_logo_secondary' => asset('storage/'.setting('site.logo_secondary')),
'favicon' => asset('storage/'.setting('admin.icon_image'))
'favicon' => asset('storage/'.setting('admin.icon_image')),
'social_media_list' => $social_media_list
]);
});
}
Expand Down
30 changes: 13 additions & 17 deletions project/resources/views/layouts/web.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,23 +150,19 @@ class="nav-link d-flex flex-column {{ Route::is('contact.index') ? 'text-seconda
</div>
<div class="d-flex flex-column flex-sm-row justify-content-between py-4 border-top">
<p>© 2024 {{ $site_name }}. All rights reserved.</p>
<ul class="list-unstyled d-flex">
<li class="ms-3">
<a class="link-body-emphasis" href="#">
<i class="bi bi-twitter fs-24"></i>
</a>
</li>
<li class="ms-3">
<a class="link-body-emphasis" href="#">
<i class="bi bi-instagram fs-24"></i>
</a>
</li>
<li class="ms-3">
<a class="link-body-emphasis" href="#">
<i class="bi bi-facebook fs-24"></i>
</a>
</li>
</ul>
@if(!empty($social_media_list))
<ul class="list-unstyled d-flex">
@foreach($social_media_list as $item)
<li class="ms-3">
<a class="link-body-emphasis" href="{{ $item->link }}" target="_blank" rel="noopener">
@if(!empty($item->icon))
<i class="{{ $item->icon }} fs-5"></i>
@endif
</a>
</li>
@endforeach
</ul>
@endif
</div>
</div>
</footer>
Expand Down
12 changes: 7 additions & 5 deletions project/resources/views/web/article/detail.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,13 @@ class="text-body-secondary">{{ $item->published_at_text ?? $item->published_at }
@endif
<div class="p-4">
<h4 class="fst-italic">Elsewhere</h4>
<ol class="list-unstyled">
<li><a href="#">GitHub</a></li>
<li><a href="#">Twitter</a></li>
<li><a href="#">Facebook</a></li>
</ol>
@if(!empty($social_media_list))
<ol class="list-unstyled">
@foreach($social_media_list as $item)
<li><a href="{{ $item->link }}" rel="nofollow">{{ $item->name }}</a></li>
@endforeach
</ol>
@endif
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions project/resources/views/web/home/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@endsection
@section("content")
@if(!empty($slider_list))
<div class="owl-carousel slider-section home-slider mb-5" data-ride="carousel">
<div class="owl-carousel slider-section home-slider" data-ride="carousel">
@foreach($slider_list as $item)
<div class="slider-item">
@if($item->type == 'IMAGE')
Expand All @@ -29,7 +29,7 @@
@endforeach
</div>
@endif
<div class="container marketing">
<div class="container marketing mt-5">
<!-- Three columns of text below the carousel -->
<div class="row">
<div class="col-lg-4">
Expand Down
12 changes: 7 additions & 5 deletions project/resources/views/web/news/detail.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,13 @@ class="text-body-secondary">{{ $item->published_at_text ?? $item->published_at }
@endif
<div class="p-4">
<h4 class="fst-italic">Elsewhere</h4>
<ol class="list-unstyled">
<li><a href="#">GitHub</a></li>
<li><a href="#">Twitter</a></li>
<li><a href="#">Facebook</a></li>
</ol>
@if(!empty($social_media_list))
<ol class="list-unstyled">
@foreach($social_media_list as $item)
<li><a href="{{ $item->link }}" rel="nofollow">{{ $item->name }}</a></li>
@endforeach
</ol>
@endif
</div>
</div>
</div>
Expand Down

0 comments on commit 320ff07

Please sign in to comment.