From 3e990667dc27f4abe835161b5398b5430bfe0158 Mon Sep 17 00:00:00 2001 From: Christopher Abey Date: Tue, 29 Jun 2021 15:37:24 +0100 Subject: [PATCH] Added ability to add placeholders to input and text area components --- resources/views/components/horizontal-input.blade.php | 1 + resources/views/components/horizontal-textarea.blade.php | 1 + resources/views/components/input.blade.php | 1 + resources/views/components/textarea.blade.php | 1 + 4 files changed, 4 insertions(+) diff --git a/resources/views/components/horizontal-input.blade.php b/resources/views/components/horizontal-input.blade.php index 71e696a..dc8dd3b 100644 --- a/resources/views/components/horizontal-input.blade.php +++ b/resources/views/components/horizontal-input.blade.php @@ -16,6 +16,7 @@ class="input @if($errors->has($name)) is-danger @endif" @endif @if($required) required @endif @if($readonly) readonly @endif + @if($attributes->has('placeholder')) placeholder="{{ $attributes->get('placeholder') }}" @endif /> diff --git a/resources/views/components/horizontal-textarea.blade.php b/resources/views/components/horizontal-textarea.blade.php index 1660091..d012751 100644 --- a/resources/views/components/horizontal-textarea.blade.php +++ b/resources/views/components/horizontal-textarea.blade.php @@ -11,6 +11,7 @@ class="textarea @if($errors->has($name)) is-danger @endif" @if($attributes->has('wire:model')) wire:model="{{ $attributes->whereStartsWith('wire:model')->first() }}" @endif @if($required) required @endif @if($readonly) readonly @endif + @if($attributes->has('placeholder')) placeholder="{{ $attributes->get('placeholder') }}" @endif >{{ old($name, $value) }} diff --git a/resources/views/components/input.blade.php b/resources/views/components/input.blade.php index 6b4bfcd..c13fa09 100644 --- a/resources/views/components/input.blade.php +++ b/resources/views/components/input.blade.php @@ -11,6 +11,7 @@ class="input @error($name) is-danger @enderror" @endif @if($required) required @endif @if($readonly) readonly @endif + @if($attributes->has('placeholder')) placeholder="{{ $attributes->get('placeholder') }}" @endif /> diff --git a/resources/views/components/textarea.blade.php b/resources/views/components/textarea.blade.php index d36cc26..0c64015 100644 --- a/resources/views/components/textarea.blade.php +++ b/resources/views/components/textarea.blade.php @@ -9,6 +9,7 @@ class="textarea @if($errors->has($name)) is-danger @endif" @if($attributes->has('wire:model')) wire:model="{{ $attributes->whereStartsWith('wire:model')->first() }}" @endif @if($required) required @endif @if($readonly) readonly @endif + @if($attributes->has('placeholder')) placeholder="{{ $attributes->get('placeholder') }}" @endif >{{ old($name, $value) }}