Skip to content

Commit

Permalink
Remove site_name
Browse files Browse the repository at this point in the history
  • Loading branch information
realodix committed Jan 20, 2025
1 parent f19faa5 commit 1f70ab4
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 19 deletions.
4 changes: 0 additions & 4 deletions app/Settings/GeneralSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

class GeneralSettings extends Settings
{
public string $site_name;

public bool $anyone_can_shorten;

public bool $anyone_can_register;
Expand All @@ -34,15 +32,13 @@ public static function group(): string
public function update(): void
{
request()->validate([
'site_name' => ['required', 'string', 'max:25'],
'keyword_length' => ['required', 'numeric', 'between:2,20'],
'custom_keyword_min_length' => ['required', 'numeric', 'between:2,19'],
'custom_keyword_max_length' => ['required', 'numeric', 'between:3,20'],
'redirect_cache_max_age' => ['required', 'numeric', 'between:0,31536000'],
]);

$this->fill([
'site_name' => request()->input('site_name'),
'anyone_can_shorten' => request()->boolean('anyone_can_shorten'),
'anyone_can_register' => request()->boolean('anyone_can_register'),
'keyword_length' => request()->input('keyword_length'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
{
public function up(): void
{
$this->migrator->add('general.site_name', 'UrlHub');

$this->migrator->add('general.anyone_can_shorten', true);
$this->migrator->add('general.anyone_can_register', true);

Expand Down
2 changes: 1 addition & 1 deletion resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@section('content')
<div class="flex flex-col min-h-screen sm:justify-center items-center pt-6 sm:pt-0">
<div class="logo text-4xl sm:text-6xl">
<a href="{{ url('/') }}">{{ settings()->site_name }}</a>
<a href="{{ url('/') }}">{{ config('app.name') }}</a>
</div>

@if(session()->has('login_error'))
Expand Down
2 changes: 1 addition & 1 deletion resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@section('content')
<div class="flex flex-col min-h-screen sm:justify-center items-center pt-6 sm:pt-0">
<div class="logo text-4xl sm:text-6xl">
<a href="{{ url('/') }}">{{ settings()->site_name }}</a>
<a href="{{ url('/') }}">{{ config('app.name') }}</a>
</div>

<div class="auth-card">
Expand Down
6 changes: 0 additions & 6 deletions resources/views/backend/settings.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
<form method="post" action="{{ route('dboard.settings.update') }}" class="space-y-6">
@csrf
<div class="grid grid-cols-6 gap-6">
<div class="col-span-6 lg:col-span-4">
<label class="form-label">Site Name</label>
<input name="site_name" value="{{ $settings->site_name }}"
class="form-input mt-4 md:mt-1 @error('site_name') !border-red-300 @enderror">
</div>

<div class="col-span-6 lg:col-span-4">
<label class="form-label">Allow Anyone to Shorten URLs</label>
<div class="font-light text-sm">Enable to allow anyone to create short URLs. If disabled, only registered users can create them.</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/auth.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<title>@yield('title') | {{ settings()->site_name }}</title>
<title>@yield('title') | {{ config('app.name') }}</title>

@vite(['resources/css/main.css', 'resources/js/app.js'])
</head>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/backend.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="csrf-token" content="{{ csrf_token() }}">

<title>@yield('title') | {{ settings()->site_name }}</title>
<title>@yield('title') | {{ config('app.name') }}</title>

@livewireStyles
@vite(['resources/css/main.css', 'resources/js/app.js'])
Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/frontend.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="csrf-token" content="{{ csrf_token() }}">

<title>{{ settings()->site_name }} - Simplify your links</title>
<title>{{ config('app.name') }} - Simplify your links</title>

@livewireStyles
@filamentStyles
Expand Down
2 changes: 1 addition & 1 deletion resources/views/partials/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@endif
>
<div class="layout-container flex px-4 sm:px-6 lg:px-8 h-16 justify-between" :class="{ 'sm:hidden': atTop }">
<a class="navbar-brand logo" href="{{ url('/') }}">{{ settings()->site_name }}</a>
<a class="navbar-brand logo" href="{{ url('/') }}">{{ config('app.name') }}</a>

<x-nav-dropdown/>

Expand Down
1 change: 0 additions & 1 deletion tests/Feature/AuthPage/SettingsPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public function test_validForm(): void
private function formData(?array $value = null): array
{
$data = [
'site_name' => 'Laravel',
'anyone_can_shorten' => true,
'anyone_can_register' => true,
'keyword_length' => 7,
Expand Down

0 comments on commit 1f70ab4

Please sign in to comment.