Comments (8)
@jeffturcotte I use this for working with HTMX
https://github.com/inmanturbo/turbohx/blob/main/src/TurboHX.php
You can install it with composer require inmanturbo/turbohx
no docs or readme yet but I suppose I'll get around to it if others are going to use it. PR's welcome.
from folio.
It doesn't make sense to have "views" for POST, PUT, and DELETE, as it should handle form requests and redirect/throw errors.
from folio.
I don't think it was ever intended for Folio to have routes other than GET, sorry.
from folio.
I don't think it was ever intended for Folio to have routes other than GET, sorry.
So this should at least be documented? We need to care about new users too.
Why will the "Controller" class be kept even though it is apparently useless? To guide new users perhaps? It's the same reasoning.
from folio.
If you just want to eliminate the need for controllers and/or route entries altogether, you can use https://github.com/livewire/volt together with folio to handle CRUD functionality from right within your views
from folio.
Can this be reconsidered?
In a situation where you are using HTMX or similar client library, it is not uncommon to have all methods GET/PUT/POST/DELETE returning HTML to swap into the dom. It would be amazing and incredibly convenient to be able to use Folio's page-based routing in such scenarios. I don't see why the limitation is needed here and seems to just have been inherited because (I believe) the standard Route::fallback handler is used. Traditional "page-based routing", where you'd throw a bunch of PHP files into a directory, worked with every method. :)
Ideally, there'd be a way to configure this via the ServiceProvider for a given folio path. I'm not advocating for the filename based solution in the original post.
From the HTMX docs:
Submitting a form via htmx has the benefit of no longer needing the Post/Redirect/Get Pattern. After successfully processing a POST request on the server, you donβt need to return a HTTP 302 (Redirect). You can directly return the new HTML fragment.
Thanks!
from folio.
Thanks @inmanturbo! My comment still stands, but I'll take a look at your package. π :)
from folio.
@jeffturcotte It depends on Folio, binds another manager and brings in all methods. Also a few matchers for catching many routes in a single file as described in this pr: #119
from folio.
Related Issues (20)
- The shared variable in the `render` function can not be accessed between `@php` and `@endphp` directives HOT 1
- Default route name HOT 1
- Create paths automatically when not exists HOT 2
- `index` blade file with deeply nested model route binding not working HOT 3
- Folio should work with other template engines (like Twig) HOT 1
- name route function is not working in folio HOT 1
- Nested model route binding disables views HOT 3
- Nested model route binding keeps disabling views HOT 3
- Empty segments in multi-segment wildcard views are not possible HOT 1
- Wildcard route collision HOT 6
- Route model binding connection HOT 5
- Missing URI prefix when calling `php artisan folio:list` HOT 1
- domain() works with only one domain. HOT 5
- Can't generate url route which starts with "/index" HOT 2
- Check if foo.blade.php file_exists for static route before taking /[param] for account? HOT 4
- Add support for dynamic route name HOT 1
- Folio Route Fallback HOT 8
- allow custom route registrar action for volt HOT 2
- Support Fragment directive
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from folio.