MilenKo
MilenKo
Explore posts from servers
TLCTuto's Laravel Corner
Created by MilenKo on 10/2/2024 in #💡filament
Spatie Settings with Filament CheckboxList
Hello gents. I am posting here a topic which I've also posted in Filament but so far could not get any luck figuring out the things. My idea was to build a Filament-Starter-Kit which can be freely used to download, install and have a full admin panel with Filament + Jetstreal (using last one to allow 2FA) + Settings page with an example for every input and many other plugins I manage to install like Spatie Roles& Permissions, Backup etc. So I got all setup with latest filament + jetstream + Spatie settings and have built a Settings page with a few examples. The issue started when I tried to add a Form CheckboxList input to Settings as I am defining the $settings_checkboxlist as string and Filament complained that I cannot store an array to a string type variable. If I try to set it up as an array type variable, Filament complains again that I am trying to store data to an array type variable, so I am stuck and can't move forward trying to figure out what is going on. From what I am reading, to store the data, I somehow need to cast the $site_checkboxlist inside the GeneralSettings.php which extends the settings, but so far I could not figure it out how to cast it properly so that the data is stored and I can continue adding other fields. long story short, how to store array data to Settings page... Here is the link to the filament topic where I've shared also the link to the repo itself with the latest code... https://discord.com/channels/883083792112300104/1290405438575087647 Any help is more than appreciated as I am trying to build complex admin in order to learn it, have some coding fun and share it with the community afterwords...
8 replies
FFilament
Created by MilenKo on 9/30/2024 in #❓┊help
Spatie Settings Checkboxlist
No description
27 replies
FFilament
Created by MilenKo on 9/13/2024 in #❓┊help
Table Actions Column Label alignment
Hello All. It might sound silly but I've been trying to figure out a way to just align the resource Actions column in the table view and I can't seem to find a way to achieve just that silly action. By default all the Table columns have their content and labels aligned to the left, but the actions table column has a right alignment. Based on the documentation, I am able to align the actions themselves to left/right using helper classes, but what I am after is to set the alignment for the label itself. To set the Actions column inside the resource table view I am using: ->actionsColumnLabel('Actions') (where 'Actions' is the desired column name). Even though there is a helper class to align the actions for each row, I am struggling to find a way to provide an extra class or alignment to the label itself. Also I am in a research of a way to add an icon to any table column to make the tables more expressing or UI appealing, however I seem to struggle to pass an icon() tag as well... Any ideas or suggestions to have a simple and elegant solution?
14 replies
TLCTuto's Laravel Corner
Created by MilenKo on 9/13/2024 in #💡filament
Action column Label
Hello all. Maybe it sounds like a silly question but I can't seem to find a way to set the Filament Table Actions column with a label and that the label is left aligned as the rest of the columns are. Yes, I am able to set the Actions table column label and yes, I can align the actions myself manually but how about the Column Label itself as the label 'Actions' I set always remain to right even if I set the actions alignment to be Left... Maybe I should introduce a custom class or else, but so far I am not able to achieve this simple step so any help is more than welcome
4 replies
TLCTuto's Laravel Corner
Created by MilenKo on 9/12/2024 in #💡filament
Navigation Groups order
Hello all. I've got into the same trouble as the author of the post, however adding the navigastionGroups to AdminPanelProvider does not seem to resolve my navigation groups order and instead they are ordered in an Alphabetical order. Here is my navigationGroups markup: // Define the navigation groups state (open/closed by default) ->navigationGroups([ NavigationGroup::make() ->label('Employees Management') ->collapsed(), NavigationGroup::make() ->label('Users Management') ->collapsed(), NavigationGroup::make() ->label('System Management') ->collapsed(), ]); However the order is strangely set to: Employees Management, System Management and Users Management Any ideas how can I resolve the order as I've been reading and reading documentations and followed several tutorials, however so far the only way to reorder the navigation groups was by using the following suggested code related to translations: // Define the navigation groups order and labels ->navigationGroups([ 'Users Management' => NavigationGroup::make(fn() => ('Users Management')), 'Employees Management' => NavigationGroup::make(fn() => ('Employees Management'))->collapsed(false), 'System Management' => NavigationGroup::make(fn() => __('System Management')), ]); Having used this code DOES ORDER my groups in any way I need them, however it ignores the state of the navigation group and I cannot set it as collapsed(false) Btw, using the shorter version of ordering (just for the sake of testing): ->navigationGroups([ 'System Management', 'Users Management', 'Employees Management', ]); Did not order the navigation groups as well... Besides I need to be able to define the state of a group (either it is collapsible or not)...
2 replies
TLCTuto's Laravel Corner
Created by MilenKo on 9/1/2024 in #💡filament
Filament Labels not showing in bold
Hey @tuto1902 , all I am following the LMS tutorial videos rthat I've started live, but had to postpone because of some work required on another project and now that I am back I've noticed some minor issue that buggs me a bit and I can't seem to figure out what is causing it. It all works as the demo says and I had to do some fine tuning as the LMS Series were finished around mid January and ever since Filament and Livewire (I believe so) has also updated in versions which caused some installation conflicts to resolve. My issue is that for some bizarre reason the Labels in Course view (the one listing all episodes) are not showing in bold (e.g. Your Teacher, Description etc.). To be fair, I did copy the original file from the repo to compare assuming I've made a silly typo etc. but even with your code I am still facing the same issue. And yes, I did edit the tailwind.config.js and it contains the following lines, which should allow the tailwind tio be properly applied to all views:
import preset from './vendor/filament/support/tailwind.config.preset'

export default {
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./app/Livewire/**/*.php',
'./resources/views/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
}
import preset from './vendor/filament/support/tailwind.config.preset'

export default {
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./app/Livewire/**/*.php',
'./resources/views/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
}
Does anybody has an idea what could cause such an issue as most of my projects were based on Bootstrap X and I am still figuring out the magic of TailWind. For sure I can have some workarounds to achieve the same result as the demo pages but the idea of learning is to also explore and figure things out on the way of a problem. Currently I am at Episode 10. As I said, not a biggie, just tryiung to get my head around the possible issue and have it resolved for good 😉
9 replies
TLCTuto's Laravel Corner
Created by MilenKo on 7/23/2024 in #🚀laravel
Laravel Cashier (Stripe) payments with form validation, database record and a success message
Hey @tuto1902 I was following your YouTube livestream about the cool way of using Laravel Cashier with Stripe and I got all bits and pieces working, however there were a few small issues in the final result. I left a few comments on the video but I've seen it has been inactive for some time so I figured out to ask here (no blame at all, just a question 😉 ) So in the videos you've covered a simple scenario of having some premium subscription plans and a lifetime payment. Since the plans were recurring, Stripe responds correctly and returns the proper actions after payment. However if you try the code with the lifetime payment, Stripe returns an error that at least one subscription is required. Anyway, my question is not about that as my current project has only reoccurring subscriptions. What I need to achieve is the following process: 1,. A resource form is shown to allow the user to add premium content. 2. The form POST data gets validated upon publishing. 3. If the validation succeeded and all inputs are OK, the user should get redirected to Stripe to pay for the resource to be added 4. If/Once the payment has succeeded, the resource should get stored in the database and the user should get the success (or error message in a case where the payment did not go through and the resource gets stored as a draft until paid).
7 replies
TLCTuto's Laravel Corner
Created by MilenKo on 2/21/2024 in #🚀laravel
Laravel notifications approach for live messasges
Hello all. I am working on a Laravel Blade project where I need to implement a live messaging system using Munafio's cool plugin Chatify. Everything works, I am able to connect Chatify to Pusher back and forth, receiving events etc. So my question is more of the best approach rather than how specifically to achieve it. So I have a usual setup of Laravel where all my templates extend the default app.blade.php inside of which I have included the header markup for the live notifications. Since the idea is to have the notifications show for authenticated users on any of the templates, I could not just pull some data and pass it to the default layout as it is used for extending and not for navigating. So my question is, how would you do the setup if your default temnplate contains the header markup for the notifications counter which when clicked would shoe either the last X-messages and the new ones will be in another color/bold (like FB styling) or to just show the new notifications (depending on the project coordinators decision).
5 replies
TLCTuto's Laravel Corner
Created by MilenKo on 12/27/2023 in #💡filament
Filament-selectify
Hello all. Merry Christmass and a Happy New Year! For those who believe still in Santa, I thought to take a lead and share something interesting I've found. I am not in any way related to it (unfortunately) but just thought that for people who would like to make their coding life easier and like to use for their projects the mighty Filament admin panel , this would be a perfect addition: https://github.com/andrewdwallo/filament-selectify In other words, this plugin allows adding a new custom field using selectify with a ON-OFF switcher as well as a button group with options similar/close to filament standards. Happy Coding! @tuto1902 Maybe it will be nice to have a separate channel for filament addons/plugins/mods where those can be shared, indexed and used by people like myself who are discovering something new everyday and have no issues sharing it if/when found useful 🙂
2 replies
TLCTuto's Laravel Corner
Created by MilenKo on 11/19/2023 in #🚀laravel
Nova vs Filament Admin Panels
Hello guys. Maybe a rookie question in terms of Admin panels, but does anyone of you see any benefits of using Nova vs Filament or vice versus excluding the price terms, which is clear for me? What I am asking myself is should I spend some dime to invest in Nova or I should stick to the good old so far so good Admin panel which thanks to @tuto1902 and the great community I've learned and extended to cover all my project needs so far. Here are the points that I am thinking of: 1. Performance 2. Ease of install 3. Ease of upgrade without sacrificing any data 4. Ease of adding panels/fields/forms etc. 5. Modules extension and extra functionality without some crazy coding and time investment. In other words, anybody can share their PROS or CONS for any of the two, which could help others take their own decision. I personally liked Filament since v2, but I did not dare to use it much in projects before master minds like Tuto, Toni and many others gave me enough kicks to start small and realize its true potential. These days there are just 2 things I've not done yet - payments for plans or per item terms as well as having custom admin theme for the complete admin panel (and no, I am not talking about filament theme with changed colours, but real custom-built Admin Panel that is implemented by client's requests or your premium admin you have purchased some time ago and would like to use for a project). I, for sure, like the free Filament as Nova is a great supporter to Laravel main mastermind but for a tiny project paying the fee sometimes is an overkill. What is your experience with both and what you dis/liked about one vs the other?
7 replies
TLCTuto's Laravel Corner
Created by MilenKo on 11/7/2023 in #🚀laravel
Filepond image gallery issue
Hello everyone. I am baddly suffering of puling my hairs while fioghting with Filepond to allow a simple user gallery to allow: 1. Image adding 2. Image re-ordering 3. Pre-existing images showing in the gallery 4. Update of any image from the gallery and post back to DB and file storage I am able to do steps 1-3 no worries and almost any script would do that, but when we need to edit existing images, I am not sure how to pass them as objects as I am able to pass their ID, name and src (full image path) but when I remove one image from existing (for example) and then try to resubmit, it does not validate as it does not see the images as objects. Tried with another simpler gallery as I can live without image reordering, but that did not work either because of the same issue. The current one I am testing is: jquery image-uploader-master. Has anyone made ever a gallery to allow to show existing images, remove/add new images, clean what is old and got removed and resubmit back the proper data? Any gallery would work as far as I can make it work as it has been too long and I am surprised all the tutorials, videos, manuals etc. I've read are only talking about adding images, but not removing and updating/reordering those... Starting to think I should build my own gallery at this time, but I just want to finish my project and focus on the PET CLINIC as I am sooo behind... 😦
5 replies
FFilament
Created by MilenKo on 9/17/2023 in #❓┊help
Show more than one resource inputs into a single Table\Column
Hello all. Sorry if my question sound silly as I am new to Filament I was trying to read through the documentation for a simple and an elegant way to present the data from multiple table columns into a single one as merged. As an example, I have two fields: date and time where I add the day of event and time of it. In the edit form, I am presenting both separately but in the List I would like to merge the two (e.g. d/m/y - h:i instead of showing extra columns. Why would I separate the two instead of providing a single field DateTime - well it is a project that is required to have events with parameter: start_date, start_time, end_date and end_time. I know i is easy to join the two but I find the picker a bit hard for a non-tech savvy person and my friend asked specifically not to take this way but to have separate input fields. In terms of data storing, it all works perfectly fine and I am totally fine with the parameters used, just not finding a way to merge date and time into a single Table\Column field. If someone can at least point me to the documentation example as I feel it is all documented and I am just not searching for the right keywords...
2 replies
TLCTuto's Laravel Corner
Created by MilenKo on 9/17/2023 in #💡filament
Show multiple table columns in a single table column of ressource
Hey guys, me again. I am trying to find some documentation/info about how can I show in a table column the joined data from two fields (e.g. start_date and start_time which are two separate inputs of date/time would like to become: 21/12/2023 - 16:15 instead of showing each column separately. I believe we've done that with the pet clinic, but since I've started the project from video 1, I might have lost or not yet reached some of the merged data practice. Any hint or a link where to look as I seem to have some weird difficulty finding data in the documentation but I am not sure it is the fault of the DEVs who wrote the data
11 replies
TLCTuto's Laravel Corner
Created by MilenKo on 9/17/2023 in #💡filament
Edit Create resource title text
No description
7 replies
TLCTuto's Laravel Corner
Created by MilenKo on 9/15/2023 in #💡filament
Show record index in table row
Hey guys, I know this might sound a bit silly but I was reading the documentation of Filament and seem to not get my head around how can I show a simple table rows index instead of record id. Why I need that? Sometimes when we edit records and re-add some new, the ID of the table changes (of course) but we would still like to present the first one as 1, second as 2 etc. I am sure I am missing something ridiculously simple but just to speed up the custom project development and ask the great knowledge here to share some more, I will wait patiently for the answer to laugh at my miss (again) 🙂
17 replies
TLCTuto's Laravel Corner
Created by MilenKo on 9/14/2023 in #💡filament
How to use custom Admin UI with Filament
Hello guys. II've been with Laravel for a year or so and I love it so far. So is with Livewire which surprised me with it's simplicity in many occasions in terms of dynamics and code easiness to digest. I've came across Filament in a few months so I am still learning my way through this incredible ecosystem but I feel comfortable now thanks to tuto and many other contributors to build a semi-complex project on my own. The one thing that I would like to know and I've done some research on it already is how can we build a fully customized admin theme still using Filament under the hood. And by fully customized theme I am not meaning to change colors, backgrounds, icons etc. that Filament already allow with the custom theme, but what I mean is to use the incredible power to build quickly with Filament but use a custom ADMIN UI like AdminLTE, CoreUI or any other admin design that a project requires us to use. And yes, that would mean to change many templates etc. but maybe this would be an extended theme or whatever it is called, as otherwise if we all use the default Filament, one day all web admins will look identical and a bit boring for that matter. Any ideas, suggestions or directions are more than welcome. P.S. I've seen some people talking about Filament with Bootstrap 5 etc. so if they succeeded to swap the Tailwind with BS I guess there is always a way, just not aware how hard it is and what is the optimal approach to start my ressearch in that direction...
5 replies
TLCTuto's Laravel Corner
Created by MilenKo on 9/13/2023 in #🚀laravel
Illuminate/Support not loaded while trying to install nunomaduro/larastan
Hello there friends. As part of following the Pet Clinic project and learn the filament admin inside out I decided to start fresh (I've joined later than the first class the livestream) so I've just created a new petclinic.lar project locally and it is all set, but when I attempt to follow up with the video and install larastan, I got a weird error using the composer command: composer require nunomaduro/larastan:^2.0 --dev:
PS C:\OpenServer\domains\petclinic.lar> composer require nunomaduro/larastan:^2.0 --dev
./composer.json has been updated
Running composer update nunomaduro/larastan
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Root composer.json requires nunomaduro/larastan 2.0 -> satisfiable by nunomaduro/larastan[2.0.0].
- nunomaduro/larastan 2.0.0 requires illuminate/console ^9 -> found illuminate/console[v9.0.0, ..., v9.52.15] but these were not loaded, likely because it conflicts with another require.


Installation failed, reverting ./composer.json and ./composer.lock to their original content.
PS C:\OpenServer\domains\petclinic.lar> composer require nunomaduro/larastan:^2.0 --dev
./composer.json has been updated
Running composer update nunomaduro/larastan
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Root composer.json requires nunomaduro/larastan 2.0 -> satisfiable by nunomaduro/larastan[2.0.0].
- nunomaduro/larastan 2.0.0 requires illuminate/console ^9 -> found illuminate/console[v9.0.0, ..., v9.52.15] but these were not loaded, likely because it conflicts with another require.


Installation failed, reverting ./composer.json and ./composer.lock to their original content.
Does anyone has an idea what might be wrong as it is a brand new project using PHP 8.1, any other packages were correctly installed and project ready to go, just that I would like to see what larastan does as well and seems to have an issue with that... I've read in StackOver that I should check my composer.json and remove any Illuminate\Support if there and do a composer update, but that did not help much and I did not even had that line.
22 replies
TLCTuto's Laravel Corner
Created by MilenKo on 9/12/2023 in #💡filament
Working on a Laravel Filament project using remote Shared Hosting
Hello guys. As part of my "training punishment" I decided to try to install a fresh Laravel + Filament project on my shared cPanel hosting and edit the files locally with a remote sync. Why am I trying this - simple, I switch PCs often as part of my IT work related day so having a centralized project space would allow me to edit from wherever whenever. So far, I've discovered a package provided from Micro$oft named RemoteSSH which allows you to connect to a shared host, lists all your files in the editor and you update directly. The issue with this approach is that when you need to transfer some files to the host, you can't copy/paste the folder or multiple files at once in VSCode (or at least it did not work with me to transfer 20Mb of assets). Besides that, the connection is reset quite often and it is almost impossible to reconnect without restarting the PC or else. Another issue with RemoteSSH is that I am unable to execute any of the composer/artisan/filament commands. It just sends the command, no messages of an error but no actions either so when you want to create a full resource with this tool, you should manually create a model, controller, migration etc. etc. Later on, I've discovered another way of achieving my needs, which seems to be more elegant (not flawless again but workable) - using SSHFS-Win application (available for free in GitHub etc.). So what this app does is mapping a remote host to a specific drive letter of choice (or a folder under Linux) so that any IDE would access it as a local project allowing copy/paste etc. This method seems a bit more reliable, stable etc. however I started noticing an issue with the File Format on SAVE with VSC as it tries several times to save and I guess it starts to loop. Since this method is opening the project as a local, it allows me to open a local console so I am lead to believe I can use it to issue all Laravel commands.
9 replies