Replies: 5 comments 6 replies
-
In v6, we will be moving away from Vue, which it looks like this example is using. Unless I’m misunderstanding the ask, I don’t see this as being something we’d use moving forward. |
Beta Was this translation helpful? Give feedback.
-
Another thing - and this will be a much, much harder part, after convincing us to take the changes in the first place - is to be able to present these changes in a way that we can actually consume them - one PR with a bajillion file changes is going to be extremely hard for us to merge. If there's any way that we can take the changes in an incremental fashion, that will be much easier for us to take. One thing you might be able to do is publish a 'raw' PR of all of your changes all at once, maybe, and then we can say "okay, give us one PR with just this bit here, and we can take that...but first things first, we need to know that these changes simplify the code enough for us to want it in the first place. |
Beta Was this translation helpful? Give feedback.
-
I updated the example above to fix some errors. I had to add a function getName() so that the name for the users is people not users in the dashboard and the can statement was wrong since the type was not selected for the model. Now it works better than the original because the link to all assets etc. was always shown and the German title for accessories now is shown but with the wrong encoding i think because the 'ö' in 'Zubehör' is now a '?'. Before it wasn't shown at all. |
Beta Was this translation helpful? Give feedback.
-
Currently I have only changed this example. My student has changed another one. For me the most interesting things before continuing:
I would really appreciate if somebody would discuss this with me here. |
Beta Was this translation helpful? Give feedback.
-
I created an alternative to the above example. Here the data is now completely defined in the class or given to the class by a parameter and the blade is just the visual presentation. What do you think? resources\views\dashboard.blade.php
resources\views\components\dashboard\panel\item.blade.php
app\View\components\dashboard\panel\item.php
|
Beta Was this translation helpful? Give feedback.
-
Hi all,
we are planning to use snipe-it for our group at the university and have some stuff we would like to change.
So I found a student and we both started reading Laravel documentations, starring at the code and trying some things to find out what happens. While doing this we found lots of small errors with phpstorm which clearly came from refactoring lots of repetitions of repeating code. Like opening a header level three and closing it with level 6, and so on.
I then tried to find out what the best way is to structure the code, so that there are less repetitions and read about the blade components which are available since Laravel 7 and now, since the beta-version has changed to version 8, as well in snipe-it.
I then, to understand this feature started to try this feature and came to the following code snippets for the dashboard panel:
resources\views\dashboard.blade.php
resources\views\components\dashboard\panel.blade.php
resources\views\components\dashboard\panel\item.blade.php
Together with the two corresponding files in app\View\Components\dashboard\ panel.php and panel\item.php, where I had to add a bit stuff, f.e. the functions getCount() and getRoute() it works really good.
One sentence to our motivation to change the code is to make it easier to add for example a new category without copying stuff just by adding an additional configuration.
So here are my questions:
What I don't like currently with our code is, that the configuration of the whole panel is currently separated in multiple files. I am not completely sure if I like this or how it could be changed nicely.
I hope for a nice discussion! Thanks!
Beta Was this translation helpful? Give feedback.
All reactions