Skip to content

Commit 4c02ed6

Browse files
committed
Add Laravel Pint
1 parent cf6d6e9 commit 4c02ed6

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Laravel integration for [htmx](https://htmx.org/).
44

55
[![Latest Version on Packagist](https://img.shields.io/packagist/v/mauricius/laravel-htmx.svg?style=flat-square)](https://packagist.org/packages/mauricius/laravel-htmx)
6-
[![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)
6+
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/mauricius/laravel-htmx/run-tests.yml?branch=master&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

99
Supported Laravel Versions >= v8.80.0.

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"illuminate/contracts": "^8.80|^9.0|^10.0"
2121
},
2222
"require-dev": {
23+
"laravel/pint": "^1.7",
2324
"nunomaduro/collision": "^5.0|^6.0|^7.0",
2425
"orchestra/testbench": "^6.0|^7.0|^8.0",
2526
"phpunit/phpunit": "^9.5|^10.0",
@@ -41,6 +42,10 @@
4142
"test-coverage": "vendor/bin/phpunit --coverage",
4243
"format": "vendor/bin/pint"
4344
},
45+
"scripts-descriptions": {
46+
"test": "Runs phpunit to test the code.",
47+
"format": "Runs Pint to fix project files."
48+
},
4449
"config": {
4550
"sort-packages": true
4651
},

pint.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"preset": "psr12"
3+
}

src/LaravelHtmxServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function boot()
3131
return BladeFragment::render($view, $fragment, $data);
3232
});
3333
}
34-
34+
3535
/**
3636
* Console-specific booting.
3737
*

tests/Http/HtmxResponseTest.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ public function the_response_should_trigger_a_client_side_event_by_setting_the_h
8383
/** @test */
8484
public function the_response_supports_triggering_multiple_events()
8585
{
86-
Route::get('test', fn () => with(new HtmxResponse())
86+
Route::get(
87+
'test',
88+
fn () => with(new HtmxResponse())
8789
->addTrigger('htmx:abort')
8890
->addTrigger('htmx:load')
8991
);
@@ -108,7 +110,9 @@ public function the_response_should_trigger_a_client_side_event_after_the_settli
108110
/** @test */
109111
public function the_response_supports_triggering_after_settle_multiple_events()
110112
{
111-
Route::get('test', fn () => with(new HtmxResponse())
113+
Route::get(
114+
'test',
115+
fn () => with(new HtmxResponse())
112116
->addTriggerAfterSettle('htmx:abort')
113117
->addTriggerAfterSettle('htmx:load')
114118
);
@@ -133,7 +137,9 @@ public function the_response_should_trigger_a_client_side_event_after_the_swap_s
133137
/** @test */
134138
public function the_response_supports_triggering_after_swap_multiple_multiple_events()
135139
{
136-
Route::get('test', fn () => with(new HtmxResponse())
140+
Route::get(
141+
'test',
142+
fn () => with(new HtmxResponse())
137143
->addTriggerAfterSwap('htmx:abort')
138144
->addTriggerAfterSwap('htmx:load')
139145
);

0 commit comments

Comments
 (0)