Comments (11)
Filament uses the route()
helper to generate URLs, so what can we do here? Is this not an issue in Laravel?
from filament.
@danharrin the filters itself are handled by Filament and they don't get encoded. That's the issue.
If I encode it myself in Laravel, I get the square brackets encoded. In Filament they always shown unencoded in the url.
from filament.
Where do we handle constructing the URL then? I don't recall writing anything like that. The getUrl()
method just wraps the route()
helper
from filament.
@danharrin I can dig in if you want. Up till now I just confirmed it's happening in Filament and not in Laravel.
from filament.
Yes please
from filament.
@danharrin after some digging, Laravel is applying RFC3986 correctly. Under the hood \Illuminate\Support\Arr::query()
is called, which builds the query string like so:
/**
* Convert the array into a query string.
*
* @param array $array
* @return string
*/
public static function query($array)
{
return http_build_query($array, '', '&', PHP_QUERY_RFC3986);
}
Hence the PHP_QUERY_RFC3986
. This will make sure that the query string is encoded accordingly. And the RFC3986 rules state that square brackets may only be used in the host part of the URL.
So, coming back to my original post, Filament is NOT using Laravel to apply filters, since square brackets are visible in the URL whenever any filter is applied by the user clicking it. But whenever we route to a resource page with given filters applied accordingly (encoded square brackets), Filament does apply the filter, but after that breaks, whenever it tries to apply any other filters.
So, as mentioned earlier, in my opinion there are 2 solutions.
- Filament should encode square brackets globally.
- Or Filament keeps using square brackets unencoded (which is easier to read, but against RFC), and tries to fix applying filters to URL's that have those square brackets encoded.
@danharrin I think we should dive into that. I mean using unencoded square brackets in the url is nice, readable and works, but it's incorrect and Laravel is correctly encoding them. Are we breaking from Laravel ways or are we fixing Filament?
from filament.
Laravel is responsible for generating URLs, Livewire is responsible for updating the URL when filters are used (through JavaScript), Filament handles neither of those things
from filament.
@danharrin Guess this is a Livewire thing then. Then I'll make an issue there.
from filament.
Should be relatively easy to reproduce, add an array property with the Url
attribute on it. Gonna close this but if there is anything we can do to fix this in Filament let me know
from filament.
from filament.
I don't think you're going to get a response if you have just linked a Filament installation, its worth creating a separate description explaining how the URLs differ when generated by Laravel or Livewire and having a Wirebox with plain Livewire code.
from filament.
Related Issues (20)
- TextInputColumn mask disappears after state change HOT 1
- Tree reorderable on tables HOT 1
- Fix checkbox label description
- Description max width HOT 2
- Description alignment of text column with icon
- Move to Alpine.js Anchor plugin HOT 5
- Tooltip alignment HOT 3
- Improved colors HOT 2
- Wizard form with same relationship in multiple steps doesn't work
- Number::useLocale not working
- Custom user menu item not being translated HOT 1
- TextColumn does not resize when other column has `grow()` enabled HOT 1
- ToolTip "bubble" does not conform to its contents HOT 1
- `ImageColumn` clashes with methods on `HasWidth` trait HOT 1
- Unable to install HOT 5
- Modal select field
- Infinite redirect loop HOT 3
- ExportBulkAction Ignoring All But Last Export Type HOT 1
- Markdown editor sometimes not save the data
- Navigation Loaded Twice, Causing Badge SQL Query to Run Twice HOT 1
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 filament.