https://github.com/inmanturbo/turbohx
Send HTMX hx-post, put, patch and delete requests to your laravel/folio routes.
https://github.com/inmanturbo/turbohx
folio htmx http laravel
Last synced: 5 months ago
JSON representation
Send HTMX hx-post, put, patch and delete requests to your laravel/folio routes.
- Host: GitHub
- URL: https://github.com/inmanturbo/turbohx
- Owner: inmanturbo
- License: mit
- Created: 2024-01-29T07:09:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-27T11:13:34.000Z (6 months ago)
- Last Synced: 2025-01-31T14:59:33.830Z (5 months ago)
- Topics: folio, htmx, http, laravel
- Language: PHP
- Homepage:
- Size: 39.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# TurboHX
[](https://packagist.org/packages/inmanturbo/turbohx)[](https://github.com/inmanturbo/turbohx/actions?query=workflow%3Arun-tests+branch%3Amain)
[](https://github.com/inmanturbo/turbohx/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)[](https://packagist.org/packages/inmanturbo/turbohx)Allows you to send `HTTP` `POST`, `PATCH`,`PUT` and `DELETE` requests to your [laravel/folio](https://github.com/laravel/folio) routes.
## Installation
First install [laravel/folio](https://laravel.com/docs/10.x/folio#installation)
```bash
composer require laravel/folio
``````bash
php artisan folio:install
```Then install this package
```bash
composer require inmanturbo/turbohx
```That's it! Now you can send all types of `HTMX` and `ajax` requests to your [laravel/folio](https://github.com/laravel/folio) routes and handle them directly within your blade files.
## Usage
This package extends [laravel/folio](https://github.com/laravel/folio) to add some extra features like allowing `POST`, `PATCH`,`PUT` and `DELETE` `HTTP` methods, mostly to support using [htmx](https://github.com/bigskysoftware/htmx) or perhaps [alpine](https://github.com/alpinejs/alpine) with a few ajax calls. See
Also allows for a wilcard file to work in place of an `index.blade.php` file as described here:
> [!CAUTION]
> This allows all `HTTP` methods on all folio routes!`Folio` uses the default `Rout::fallback` method which only supports get requests. This just replaces it with `Route::any` method. May be improved in the future to allow more granular control, such as a function similiar to the `name()` function available in folio. `PR`'s welcome!
## Testing
```bash
composer test
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [inmanturbo](https://github.com/inmanturbo)
- [laravel/folio](https://github.com/inmanturbo)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.