Skip to content

Commit 506fffc

Browse files
committed
IMP: Add Favicon and fix issues.
1 parent 5900bb9 commit 506fffc

File tree

13 files changed

+39
-15
lines changed

13 files changed

+39
-15
lines changed

database/factories/SettingFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function definition(): array
2929
'title' => $this->faker->sentence,
3030
'description' => $this->faker->paragraph,
3131
'logo' => $this->faker->imageUrl(),
32+
'favicon' => $this->faker->imageUrl(),
3233
'organization_name' => $this->faker->company,
3334
'google_analytic_code' => '<script></script>',
3435
'google_adsense_code' => '<script></script>',

database/migrations/2024_03_29_052317_create_settings_table.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public function up(): void
1616
$table->string('title', 155)->nullable();
1717
$table->text('description')->nullable();
1818
$table->string('logo')->nullable();
19+
$table->string('favicon')->nullable();
1920
$table->string('organization_name')->nullable();
2021
$table->string('google_analytic_code')->nullable();
2122
$table->string('google_adsense_code')->nullable();

database/migrations/create_blog_tables.php.stub

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ return new class () extends Migration {
107107
$table->string('title', 155)->nullable();
108108
$table->text('description')->nullable();
109109
$table->string('logo')->nullable();
110+
$table->string('favicon')->nullable();
110111
$table->string('organization_name')->nullable();
111112
$table->tinyText('google_analytic_code')->nullable();
112113
$table->tinyText('google_adsense_code')->nullable();

resources/views/blogs/all-post.blade.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@
99
<section class="pb-16 pt-8">
1010
<div class="container mx-auto">
1111
<div class="grid gap-x-14 gap-y-14 sm:grid-cols-3">
12-
@foreach ($posts as $post)
12+
@forelse ($posts as $post)
1313
<x-blog-card :post="$post"/>
14-
@endforeach
14+
@empty
15+
<div class="mx-auto col-span-3">
16+
<div class="flex items-center justify-center">
17+
<p class="text-2xl font-semibold text-gray-300">No posts found</p>
18+
</div>
19+
</div>
20+
@endforelse
1521
</div>
1622
<div class="mt-20">
1723
{{ $posts->links() }}

resources/views/blogs/category-post.blade.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
@forelse ($posts as $post)
1313
<x-blog-card :post="$post"/>
1414
@empty
15-
<div class="flex justify-center w-full">
16-
<h2 class="text-2xl font-semibold">No posts found</h2>
15+
<div class="mx-auto col-span-3">
16+
<div class="flex items-center justify-center">
17+
<p class="text-2xl font-semibold text-gray-300">No posts found</p>
1718
</div>
19+
</div>
1820
@endforelse
1921
</div>
2022
<div class="mt-20">
@@ -23,4 +25,4 @@
2325
</div>
2426
</section>
2527

26-
</x-blog-layout>
28+
</x-blog-layout>

resources/views/blogs/index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class="flex items-center justify-center gap-x-5 rounded-full bg-slate-100 px-20
3434
</section>
3535
@else
3636
<div class="container mx-auto">
37-
<div class="flex items>center justify-center">
37+
<div class="flex justify-center">
3838
<p class="text-2xl font-semibold text-gray-300">No posts found</p>
3939
</div>
4040
</div>

resources/views/layouts/app.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<meta charset="utf-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta name="csrf-token" content="{{ csrf_token() }}">
8+
<link rel="icon" href="{{ $setting?->faviconImage }}" type="image/x-icon"/>
89
{!! \Firefly\FilamentBlog\Facades\SEOMeta::generate() !!}
910
{{-- {!! $setting?->google_analytic_code !!}--}}
1011
{{-- {!! $setting?->google_adsense_code !!}--}}

src/Http/Controllers/CategoryController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ class CategoryController extends Controller
99
{
1010
public function posts(Request $request, Category $category)
1111
{
12-
$posts = $category->load(['posts.user', 'posts.categories'])->posts()->paginate(25);
12+
$posts = $category->load(['posts.user', 'posts.categories'])
13+
->posts()
14+
->published()
15+
->paginate(25);
1316

1417
return view('filament-blog::blogs.category-post', [
1518
'posts' => $posts,

src/Http/Controllers/TagController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
namespace Firefly\FilamentBlog\Http\Controllers;
44

5+
use Firefly\FilamentBlog\Models\Category;
56
use Firefly\FilamentBlog\Models\Tag;
67

78
class TagController extends Controller
89
{
910
public function posts(Tag $tag)
1011
{
11-
$posts = $tag->load(['posts.user'])->posts()->paginate(25);
12+
$posts = $tag->load(['posts.user'])
13+
->posts()
14+
->published()
15+
->paginate(25);
1216

1317
return view('filament-blog::blogs.tag-post', [
1418
'posts' => $posts,

src/Models/Post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public static function getForm()
187187
->image()
188188
->preserveFilenames()
189189
->imageEditor()
190-
->maxSize(1024 * 1024 * 3)
190+
->maxSize(1024 * 5)
191191
->rules('dimensions:max_width=1920,max_height=1004')
192192
->required(),
193193
TextInput::make('photo_alt_text')->required(),

0 commit comments

Comments
 (0)