Skip to content

Commit cff8490

Browse files
committed
Release [skip ci]
1 parent 7a0b4e1 commit cff8490

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
# Changelog
22

33
All notable changes to `laravel-htmx` will be documented in this file.
4+
5+
## 0.2.0 - 2022-11-06
6+
7+
### What's Changed
8+
9+
- Added support for Laravel 8.80 and higher
10+
- Renamed `fragment` macro to `renderFragment` due to `fragment` making its way into [Laravel's core](https://github.com/laravel/framework/pull/44774).
11+
12+
## 0.1.0 - 2022-11-02
13+
14+
- Initial release

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Laravel integration for [htmx](https://htmx.org/).
66
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/mauricius/laravel-htmx/run-tests?label=tests)](https://github.com/mauricius/laravel-htmx/actions?query=workflow%3Arun-tests+branch%3Amaster)
77
[![Total Downloads](https://img.shields.io/packagist/dt/mauricius/laravel-htmx.svg?style=flat-square)](https://packagist.org/packages/mauricius/laravel-htmx)
88

9+
Supported Laravel Versions >= v8.80.0.
10+
911
## Installation
1012

1113
You can install the package via composer:
@@ -167,7 +169,7 @@ Route::get('/', function ($id) {
167169
});
168170
```
169171

170-
Or we can render only the `archive-ui` fragment of the template by using the `fragment` macro defined in the `\Illuminate\View\View` class:
172+
Or we can render only the `archive-ui` fragment of the template by using the `renderFragment` macro defined in the `\Illuminate\View\View` class:
171173

172174
```php
173175
Route::patch('/contacts/{id}/unarchive', function ($id) {
@@ -176,17 +178,17 @@ Route::patch('/contacts/{id}/unarchive', function ($id) {
176178
// The following approaches are equivalent
177179

178180
// Using the View Facade
179-
return \Illuminate\Support\Facades\View::fragment('contacts.detail', 'archive-ui', compact('contact'));
181+
return \Illuminate\Support\Facades\View::renderFragment('contacts.detail', 'archive-ui', compact('contact'));
180182

181183
// Using the view() helper
182-
return view()->fragment('contacts.detail', 'archive-ui', compact('contact'));
184+
return view()->renderFragment('contacts.detail', 'archive-ui', compact('contact'));
185+
186+
// Using the HtmxResponse Facade
187+
return \Mauricius\LaravelHtmx\Facades\HtmxResponse::renderFragment('contacts.detail', 'archive-ui', compact('contact'));
183188

184189
// Using the HtmxResponse class
185190
return with(new \Mauricius\LaravelHtmx\Http\HtmxResponse())
186-
->fragment('contacts.detail', 'archive-ui', compact('contact'));
187-
188-
// Using the HtmxResponse Facade
189-
return Mauricius\LaravelHtmx\Facades\HtmxResponse::fragment('contacts.detail', 'archive-ui', compact('contact'));
191+
->renderFragment('contacts.detail', 'archive-ui', compact('contact'));
190192
});
191193
```
192194

0 commit comments

Comments
 (0)