chore: upgrade to Laravel 11 (#7193)

This commit is contained in:
Alexis Saettler
2024-04-07 22:37:54 +02:00
committed by GitHub
parent 7ee4609bed
commit 9dbe25618f
81 changed files with 2025 additions and 3632 deletions
+29 -17
View File
@@ -5,6 +5,7 @@ namespace App\Http\Middleware;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use Inertia\Middleware;
use Tighten\Ziggy\Ziggy;
class HandleInertiaRequests extends Middleware
{
@@ -15,16 +16,6 @@ class HandleInertiaRequests extends Middleware
*/
protected $rootView = 'app';
/**
* Determine the current asset version.
*
* @return string|null
*/
public function version(Request $request)
{
return parent::version($request);
}
/**
* Define the props that are shared by default.
*
@@ -32,14 +23,18 @@ class HandleInertiaRequests extends Middleware
*/
public function share(Request $request)
{
return array_merge(parent::share($request), [
return [
...parent::share($request),
'help_links' => fn () => config('monica.help_links'),
'help_url' => fn () => config('monica.help_center_url'),
'footer' => Str::markdownExternalLink(trans('Version :version — commit [:short](:url).', [
'version' => config('monica.app_version'),
'short' => substr(config('monica.commit'), 0, 7),
'url' => Str::finish(config('monica.repository', 'https://github.com/monicahq/monica/'), '/').'commit/'.config('monica.commit'),
]), 'underline text-xs dark:text-gray-100 hover:text-gray-900 hover:dark:text-gray-200'),
'footer' => fn () => $this->footer(),
'auth' => fn () => [
'user' => auth()->user(),
],
'ziggy' => fn () => [
...(new Ziggy)->toArray(),
'location' => $request->url(),
],
'sentry' => fn () => [
'dsn' => config('sentry.dsn'),
'tunnel' => config('sentry-tunnel.tunnel-url'),
@@ -48,6 +43,23 @@ class HandleInertiaRequests extends Middleware
'sendDefaultPii' => config('sentry.send_default_pii'),
'tracesSampleRate' => config('sentry.traces_sample_rate'),
],
]);
];
}
private function footer(): string
{
$commit = config('monica.commit');
$params = [
'version' => config('monica.app_version'),
'short' => substr(config('monica.commit'), 0, 7),
];
if ($commit === null) {
$message = trans('Version :version.', $params);
} else {
$params['url'] = Str::finish(config('monica.repository', 'https://github.com/monicahq/monica/'), '/').'commit/'.config('monica.commit');
$message = trans('Version :version — commit [:short](:url).', $params);
}
return Str::markdownExternalLink($message, 'underline text-xs dark:text-gray-100 hover:text-gray-900 hover:dark:text-gray-200');
}
}