Skip to content

Commit

Permalink
Fixed date view attribute exception given in lead page
Browse files Browse the repository at this point in the history
  • Loading branch information
shivendra-webkul committed Dec 10, 2024
1 parent 0f7c722 commit 7c97839
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions config/repository.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
|--------------------------------------------------------------------------
| Prettus Repository Config
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
@php
if (! empty($value)) {
if ($value instanceof \Carbon\Carbon) {
$value = $value->format('Y-m-d');
} elseif (is_string($value)) {
$value = \Carbon\Carbon::parse($value)->format('Y-m-d');
}
}
@endphp

<x-admin::form.control-group.controls.inline.date
::name="'{{ $attribute->code }}'"
::value="'{{ $value?->format('Y-m-d') }}'"
::name="'{{$attribute->code}}'"
::value="'{{$value}}'"
rules="required"
position="left"
:label="$attribute->name"
::errors="errors"
:placeholder="$attribute->name"
:url="$url"
:allow-edit="$allowEdit"
/>
/>

0 comments on commit 7c97839

Please sign in to comment.