Skip to content

Commit dc24d53

Browse files
authored
Merge branch 'master' into optimize-blade-directives
2 parents 7001a9b + 09abaa5 commit dc24d53

File tree

4 files changed

+12
-43
lines changed

4 files changed

+12
-43
lines changed

.stubs.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Illuminate\View
6+
{
7+
class View
8+
{
9+
public function renderFragment(string $view, string $fragment, array $data = []): string {}
10+
}
11+
}

README.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,6 @@ You can install the package via composer:
1616
composer require mauricius/laravel-htmx
1717
```
1818

19-
You can publish the config file with:
20-
21-
```bash
22-
php artisan vendor:publish --tag="laravel-htmx"
23-
```
24-
25-
This is the contents of the published config file:
26-
27-
```php
28-
return [
29-
];
30-
```
31-
3219
To install htmx please browse [their documentation](https://htmx.org/docs/#installing)
3320

3421
## Usage

config/laravel-htmx.php

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/LaravelHtmxServiceProvider.php

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,15 @@ class LaravelHtmxServiceProvider extends ServiceProvider
1414
{
1515
public function boot(): void
1616
{
17-
if ($this->app->runningInConsole()) {
18-
$this->bootForConsole();
19-
}
20-
2117
$this->callAfterResolving('blade.compiler', static function (BladeCompiler $blade) {
2218
$blade->directive('endfragment', static fn () => '');
2319
$blade->directive('fragment', static fn () => '');
2420
});
2521

2622
$this->app->bind(HtmxRequest::class, fn ($container) => HtmxRequest::createFrom($container['request']));
2723

28-
View::macro('renderFragment', function ($view, $fragment, array $data = []) {
24+
View::macro('renderFragment', function (string $view, string $fragment, array $data = []) {
2925
return BladeFragment::render($view, $fragment, $data);
3026
});
3127
}
32-
33-
/**
34-
* Console-specific booting.
35-
*
36-
* @return void
37-
*/
38-
protected function bootForConsole(): void
39-
{
40-
$this->publishes([
41-
__DIR__.'/../config/laravel-htmx.php' => config_path('laravel-htmx.php'),
42-
], 'config');
43-
}
44-
45-
public function register(): void
46-
{
47-
$this->mergeConfigFrom(
48-
__DIR__.'/../config/laravel-htmx.php',
49-
'laravel-htmx'
50-
);
51-
}
5228
}

0 commit comments

Comments
 (0)