diff --git a/.env.example b/.env.example
index b1cb3f4a..34cdf006 100644
--- a/.env.example
+++ b/.env.example
@@ -66,6 +66,7 @@ VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
APP_AUTHOR="musimana"
APP_COPYRIGHT="MIT (2024)"
APP_DESCRIPTION="Laravel VILT stack template app with server-side rendering (SSR), Larastan, Pest & Dusk test suites. Created by Musimana."
+APP_IMAGE_OPEN_GRAPH="resources/img/open-graph.png"
#APP_KEYWORDS="Musimana, Bassform, Laravel, VILT"
APP_LINK_PROJECT_REPO="https://github.com/musimana/bassform"
diff --git a/README.md b/README.md
index d94b4fb0..78c36ce3 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
# Bassform - VILT SSR
+![Bassform - VILT SSR](resources/img/banner-readme.png)
+
VILT stack template app for PHP 8.2.x created by Musimana. Features include server-side rendering (SSR) and Larastan, Pest & Dusk test suites.
[Vue3](https://vuejs.org/),
diff --git a/app/Http/Controllers/Public/HomepageController.php b/app/Http/Controllers/Public/HomepageController.php
index e8dac86f..4c57935b 100644
--- a/app/Http/Controllers/Public/HomepageController.php
+++ b/app/Http/Controllers/Public/HomepageController.php
@@ -4,6 +4,7 @@
use App\Http\Controllers\Controller;
use App\Http\Resources\Views\Public\Content\HomepageContentResource;
+use App\Http\Resources\Views\Public\Metadata\HomepageMetadataResource;
use App\Repositories\Views\PublicViewRepository;
use Inertia\Response;
@@ -16,7 +17,8 @@ public function __invoke(): Response
{
return (new PublicViewRepository)->getViewDetails(
self::TEMPLATE_PUBLIC_INDEX,
- (new HomepageContentResource)->getItem()
+ (new HomepageContentResource)->getItem(),
+ (new HomepageMetadataResource)->getItem()
);
}
}
diff --git a/app/Http/Resources/Views/Public/Metadata/HomepageMetadataResource.php b/app/Http/Resources/Views/Public/Metadata/HomepageMetadataResource.php
new file mode 100644
index 00000000..73118189
--- /dev/null
+++ b/app/Http/Resources/Views/Public/Metadata/HomepageMetadataResource.php
@@ -0,0 +1,21 @@
+
+ */
+ public function getItem(): array
+ {
+ return [
+ 'openGraphImage' => Vite::asset(config('metadata.open_graph_image')),
+ ];
+ }
+}
diff --git a/config/metadata.php b/config/metadata.php
index e1773916..9ce81cab 100644
--- a/config/metadata.php
+++ b/config/metadata.php
@@ -37,6 +37,23 @@
'description' => env('APP_DESCRIPTION', ''),
+ /*
+ |--------------------------------------------------------------------------
+ | Open Graph Image
+ |--------------------------------------------------------------------------
+ |
+ | The string for the filename of the image to be used for the app's
+ | Open Graph image. Should be in the resources/images directory, so it's
+ | included in Vite's asset bundling.
+ |
+ | Max size: 8MB, 1200px x 630px.
+ | [Open Graph Docs](https://ogp.me/)
+ | [Good Blog](https://kaydee.net/blog/open-graph-image/)
+ |
+ */
+
+ 'open_graph_image' => env('APP_IMAGE_OPEN_GRAPH'),
+
/*
|--------------------------------------------------------------------------
| Social Media Links
diff --git a/resources/img/banner-readme.png b/resources/img/banner-readme.png
new file mode 100644
index 00000000..16f5b49f
Binary files /dev/null and b/resources/img/banner-readme.png differ
diff --git a/resources/img/open-graph.png b/resources/img/open-graph.png
new file mode 100644
index 00000000..8017c338
Binary files /dev/null and b/resources/img/open-graph.png differ
diff --git a/resources/js/Components/Icons/IconAppLogo.vue b/resources/js/Components/Icons/IconAppLogo.vue
index 40d40a7d..44212723 100644
--- a/resources/js/Components/Icons/IconAppLogo.vue
+++ b/resources/js/Components/Icons/IconAppLogo.vue
@@ -7,8 +7,8 @@
stroke="currentColor"
stroke-width="1"
>
-
+
-
+
diff --git a/resources/js/Components/Sections/AppHead.vue b/resources/js/Components/Sections/AppHead.vue
index f0482b39..833b2b41 100644
--- a/resources/js/Components/Sections/AppHead.vue
+++ b/resources/js/Components/Sections/AppHead.vue
@@ -23,11 +23,11 @@ defineProps({
-
-
-
-
-
+
+
+
+
+
diff --git a/resources/js/Components/Sections/AppPanelLink.vue b/resources/js/Components/Sections/AppPanelLink.vue
index 1d63c793..d9a83c85 100644
--- a/resources/js/Components/Sections/AppPanelLink.vue
+++ b/resources/js/Components/Sections/AppPanelLink.vue
@@ -12,7 +12,7 @@ defineProps({
{{ item.title }}
diff --git a/resources/js/app.js b/resources/js/app.js
index 1c713ca9..ad1ba5ee 100644
--- a/resources/js/app.js
+++ b/resources/js/app.js
@@ -7,7 +7,7 @@ import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'
import { ZiggyVue } from '../../vendor/tightenco/ziggy/dist/vue.m'
import.meta.glob([
- '../images/**',
+ '../img/**',
])
const appName = import.meta.env.VITE_APP_NAME || 'Laravel'
diff --git a/resources/views/partials/head/default.blade.php b/resources/views/partials/head/default.blade.php
index b7a9e4d8..58ead1ac 100644
--- a/resources/views/partials/head/default.blade.php
+++ b/resources/views/partials/head/default.blade.php
@@ -9,6 +9,15 @@
+ @if(config('metadata.open_graph_image'))
+
+
+
+
+
+
+ @endif
+
@if(config('metadata.author'))
@endif
diff --git a/tests/Feature/Http/Controllers/Public/HomepageControllerTest.php b/tests/Feature/Http/Controllers/Public/HomepageControllerTest.php
index dbaff1a2..2614dfe7 100644
--- a/tests/Feature/Http/Controllers/Public/HomepageControllerTest.php
+++ b/tests/Feature/Http/Controllers/Public/HomepageControllerTest.php
@@ -2,8 +2,8 @@
use App\Http\Controllers\Public\HomepageController;
use App\Http\Resources\Views\DetailsViewResource;
-use App\Http\Resources\Views\MetadataViewResource;
use App\Http\Resources\Views\Public\Content\HomepageContentResource;
+use App\Http\Resources\Views\Public\Metadata\HomepageMetadataResource;
test('TEMPLATE_PUBLIC_INDEX Vue page component exists', function () {
$template = (new ReflectionClassConstant(
@@ -33,7 +33,7 @@
$data = (new DetailsViewResource)->getItem(
(new HomepageContentResource)->getItem(),
- (new MetadataViewResource)->getItem([])
+ (new HomepageMetadataResource)->getItem()
);
expect($actual)
diff --git a/tests/Unit/App/Http/Resources/Views/Public/Metadata/HomepageMetadataResourceTest.php b/tests/Unit/App/Http/Resources/Views/Public/Metadata/HomepageMetadataResourceTest.php
new file mode 100644
index 00000000..afa70b78
--- /dev/null
+++ b/tests/Unit/App/Http/Resources/Views/Public/Metadata/HomepageMetadataResourceTest.php
@@ -0,0 +1,20 @@
+expect(HomepageMetadataResource::class)
+ ->toImplement(ConstantItemInterface::class);
+
+test('getItem returns ok', function () {
+ $actual = (new HomepageMetadataResource)->getItem();
+
+ expect($actual)
+ ->toHaveCamelCaseKeys()
+ ->toHaveCount(1)
+ ->toMatchArray([
+ 'openGraphImage' => Vite::asset(config('metadata.open_graph_image')),
+ ]);
+});