This commit is contained in:
Benjamin Takats
2022-12-15 16:29:28 +01:00
parent a1ca99620a
commit 0c5232f194
6 changed files with 2379 additions and 1834 deletions

View File

@@ -26,6 +26,7 @@
"nova/start": "*",
"oneduo/nova-time-field": "^1.0",
"podcastindex/podcastindex-php": "^1.0",
"ralphjsmit/laravel-seo": "^1.2",
"rappasoft/laravel-livewire-tables": "^2.8",
"sentry/sentry-laravel": "^3.1",
"simplesoftwareio/simple-qrcode": "^4.2",

4059
composer.lock generated

File diff suppressed because it is too large Load Diff

121
config/seo.php Normal file
View File

@@ -0,0 +1,121 @@
<?php
use RalphJSmit\Laravel\SEO\Models\SEO;
return [
/**
* The SEO model. You can use this setting to override the model used by the package.
* Make sure to always extend the old model, so that you'll not lose functionality during upgrades.
*/
'model' => SEO::class,
/**
* Use this setting to specify the site name that will be used in OpenGraph tags.
*/
'site_name' => 'Einundzwanzig Portal',
/**
* Use this setting to specify the path to the sitemap of your website. This exact path will outputted, so
* you can use both a hardcoded url and a relative path. We recommend the later.
*
* Example: '/storage/sitemap.xml'
* Do not forget the slash at the start. This will tell the search engine that the path is relative
* to the root domain and not relative to the current URL. The `spatie/laravel-sitemap` package
* is a great package to generate sitemaps for your application.
*/
'sitemap' => null,
/**
* Use this setting to specify whether you want self-referencing `<link rel="canonical" href="$url">` tags to
* be added to the head of every page. There has been some debate whether this a good practice, but experts
* from Google and Yoast say that this is the best strategy.
* See https://yoast.com/rel-canonical/.
*/
'canonical_link' => true,
'robots' => [
/**
* Use this setting to specify the default value of the robots meta tag. `<meta name="robots" content="noindex">`
* Overwrite it with the robots attribute of the SEOData object. `SEOData->robots = 'noindex, nofollow'`
* "max-snippet:-1" Use n chars (-1: Search engine chooses) as a search result snippet.
* "max-image-preview:large" Max size of a preview in search results.
* "max-video-preview:-1" Use max seconds (-1: There is no limit) as a video snippet in search results.
* See https://developers.google.com/search/docs/advanced/robots/robots_meta_tag
* Default: 'max-snippet:-1, max-image-preview:large, max-video-preview:-1'
*/
'default' => 'max-snippet:-1,max-image-preview:large,max-video-preview:-1',
/**
* Force set the robots `default` value and make it impossible to overwrite it. (e.g. via SEOData->robots)
* Use case: You need to set `noindex, nofollow` for the entire website without exception.
* Default: false
*/
'force_default' => false,
],
/**
* Use this setting to specify the path to the favicon for your website. The url to it will be generated using the `secure_url()` function,
* so make sure to make the favicon accessibly from the `public` folder.
*
* You can use the following filetypes: ico, png, gif, jpeg, svg.
*/
'favicon' => '/img/favicon.svg',
'title' => [
/**
* Use this setting to let the package automatically infer a title from the url, if no other title
* was given. This will be very useful on pages where you don't have an Eloquent model for, or where you
* don't want to hardcode the title.
*
* For example, if you have a with the url '/foo/about-me', we'll automatically set the title to 'About me' and append the site suffix.
*/
'infer_title_from_url' => true,
/**
* Use this setting to provide a suffix that will be added after the title on each page.
* If you don't want a suffix, you should specify an empty string.
*/
'suffix' => '',
/**
* Use this setting to provide a custom title for the homepage. We will not use the suffix on the homepage,
* so you'll need to add the suffix manually if you want that. If set to null, we'll determine the title
* just like the other pages.
*/
'homepage_title' => null,
],
'description' => [
/**
* Use this setting to specify a fallback description, which will be used on places
* where we don't have a description set via an associated ->seo model or via
* the ->getDynamicSEOData() method.
*/
'fallback' => null,
],
'image' => [
/**
* Use this setting to specify a fallback image, which will be used on places where you
* don't have an image set via an associated ->seo model or via the ->getDynamicSEOData() method.
* This should be a path to an image. The url to the path is generated using the `secure_url()` function (`secure_url($yourProvidedPath)`).
*/
'fallback' => '/img/einundzwanzig-horizontal.svg',
],
'author' => [
/**
* Use this setting to specify a fallback author, which will be used on places where you
* don't have an author set via an associated ->seo model or via the ->getDynamicSEOData() method.
*/
'fallback' => 'einundzwanzig',
],
'twitter' => [
/**
* Use this setting to enter your username and include that with the Twitter Card tags.
* Enter the username like 'yourUserName', so without the '@'.
*/
'@username' => '_einundzwanzig_',
],
];

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('seo', function (Blueprint $table) {
$table->id();
$table->morphs('model');
$table->longText('description')->nullable();
$table->string('title')->nullable();
$table->string('image')->nullable();
$table->string('author')->nullable();
$table->string('robots')->nullable();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('seo');
}
};

View File

@@ -7,6 +7,7 @@
<title>{{ config('app.name', 'Laravel') }}</title>
<link rel="apple-touch-icon" href="/img/apple_touch_icon.png"/>
<link rel="icon" href="/img/favicon.svg"/>
{!! seo() !!}
<!-- Fonts -->
@googlefonts
<!-- Scripts -->

View File

@@ -7,6 +7,7 @@
<title>{{ config('app.name', 'Laravel') }}</title>
<link rel="apple-touch-icon" href="{{ asset('img/apple_touch_icon.png') }}"/>
<link rel="icon" href="{{ asset('img/favicon.svg') }}"/>
{!! seo() !!}
<!-- Fonts -->
@googlefonts
<!-- Scripts -->