From bbf71bd67a48f53e4211bc1ec8fe9e885892ab22 Mon Sep 17 00:00:00 2001 From: AJ <60591772+devajmeireles@users.noreply.github.com> Date: Fri, 8 Mar 2024 13:20:10 -0300 Subject: [PATCH] wip --- app/Enums/Examples/Form/Date.php | 5 ++++- resources/views/documentation/form/date.blade.php | 6 +++--- resources/views/livewire/welcome/table.blade.php | 9 ++++++++- resources/views/welcome.blade.php | 6 +++--- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/app/Enums/Examples/Form/Date.php b/app/Enums/Examples/Form/Date.php index e728f254..518724d1 100644 --- a/app/Enums/Examples/Form/Date.php +++ b/app/Enums/Examples/Form/Date.php @@ -19,11 +19,14 @@ class Date HTML; public const CREATE_FROM_FORMAT = <<<'HTML' + // Your current date $date = '20/02/2024'; // 20/02/2024 + // Formatting $date = now()->createFromFormat('d/m/Y', $date)->format('Y-m-d'); - echo $date; // 2024-02-20 + // Same date, but now in the correct format + $date; // 2024-02-20 HTML; public const HELPERS = <<<'HTML' diff --git a/resources/views/documentation/form/date.blade.php b/resources/views/documentation/form/date.blade.php index ffa36190..2ba8430e 100644 --- a/resources/views/documentation/form/date.blade.php +++ b/resources/views/documentation/form/date.blade.php @@ -43,9 +43,9 @@

- Regardless of the format of your date, to send it to the component you - must follow the pattern YYYY-MM-DD. Therefore, if your date is different - from YYYY-MM-DD, the correct thing to do is to use Carbon's createFromFormat. + Regardless of the format of the date, to send the date to the component you + must follow the pattern YYYY-MM-DD. If the date are using a format different + than YYYY-MM-DD, the correct thing to do is to use Carbon's createFromFormat. Let's take a look at an example considering the Brazilian date format:

diff --git a/resources/views/livewire/welcome/table.blade.php b/resources/views/livewire/welcome/table.blade.php index e2864918..7ba0c32c 100644 --- a/resources/views/livewire/welcome/table.blade.php +++ b/resources/views/livewire/welcome/table.blade.php @@ -40,7 +40,7 @@ public function notify(string $user): void $user = explode(' ', $user)[0]; $this->toast() - ->error("Naaah!", "{$user} can't leave Laravel team! 😝") + ->error("Naaah!", "{$user} can't leave the Laravel team! 😝") ->send(); } }; ?> @@ -51,8 +51,15 @@ public function notify(string $user): void :$sort filter paginate + loading :quantity="[2,5,7]" id="users"> + @interact('column_name', $user) +
+ {{ $user->name }} + {{ $user->name }} +
+ @endinteract @interact('column_action', $user)
@php($now = now()->format('Y-m-d')) - - - + + +