Closed markovic-nikola closed 1 year ago
Hi,
I came up with a simple Response macro, I explained in the README file:
response()->htmx(...)
If you just want to pass the simple HTML response using Laravel view, you can also use the htmx() macro response.
htmx()
Route::get('/', fn () => response()->htmx($viewName, $viewData));
Additionally, this macro can also handle Laravel's built-in validation $errors message bag and old() input session data:
$errors
old()
Route::get('/', fn () => response()->htmx($viewName, $viewData, $validator));
This can be useful when submitting forms via HTMX and you want to show validation errors within the same response.
Hi,
I came up with a simple Response macro, I explained in the README file:
response()->htmx(...)
If you just want to pass the simple HTML response using Laravel view, you can also use the
htmx()
macro response.Additionally, this macro can also handle Laravel's built-in validation
$errors
message bag andold()
input session data:This can be useful when submitting forms via HTMX and you want to show validation errors within the same response.