-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to make changes in PanicHD Views files? #34
Comments
Hi @ashi006, One of Laravel cool features is it's view publishing mechanism, that covers exactly what you need. To customize any panichd view you have to:
For any other PanicHD view you want to customize, remember that Laravel will firstly look for it into "resources/views/vendor/panichd" and if it's not found, it will look at "vendor/panichd/panichd/src/Views". This mechanism may work for majority of other Laravel packages. Cause you mentioned updates, I wanna add that after a PanicHD update, the files in the package folder (vendor/panichd/panichd) may change. After every update you have to review that your customized files (like published views) still work, or you will have to correct them manually. |
Hi @xaviqv |
Hi @ashi006, I'm glad I could help you with views customization. In your last question I guess you are asking for customizing one of PanicHD controller methods in your app. In this case, Laravel itself doesn't provide an easy method as the view publication method you already know is. Despite that, you may achieve it by at least two different methods: The first one is the "Laravel manner" and the other is "Git manner". With the "Laravel manner", you keep your own code away from the package under vendor folder. On the other side, with the "Git manner" you will be able to edit any file under "vendor\panichd\panichd" folder without the risk of loosing your code after any app update. Laravel mannerAs an example, let's imagine that you want to customize the "index" method in PanicHD\PanicHD\Controllers\DashboardController, because you want to add extra functionality when you load "http://localhost/panichd/dashboard" in your browser. To achieve this, we're going to edit two files in our Laravel app:
The second one doesn't exist yet and the used folder is arbitrary but recommended for a polite folder structure. You may create it in any other folder within "app" and even use a different filename, but be aware of editing the code example accordingly!
Git mannerThis method requires to have Git installed on the computer you will be using to edit your Laravel app. It consists in the following ideas:
My recommendationAlthough the Laravel manner works, I'm sure that most Github users around are applying the Git manner, as it keeps the code simpler in a local app and also lets to contribute to the package source code itself. |
Hi @xaviqv, Thanks a lot for your detailed response.. Much appreciated. I have another question. But the problem is that these tickets are not showing up in the "Active" tab. Attaching the image below, it shows the number of active tickets is 4 but the table shows no data. Help me fix this issue please. |
Hi @ashi006, You may custom the create ticket form this way, but if you remove any visual form element, you must add a replacement hidden input within the form HTML tag. For your case it should be: Notice the id property, which is required also for the "Add comment" script in the same form, and used at file "views\tickets\partials\comments\embedded_scripts.blade.php" |
Hi @xaviqv, I did exactly what you told, but no success. It still only updates the count but doesn't show any data in datatable. :-( |
Hi @ashi006, Please check your database at panichd_tickets table if there is any new row after you create a new ticket using your custom form. |
Hi @xaviqv,
I'm back.. :-)
There is this view file called form.blade.php
vendor/panichd/panichd/src/Views/tickets/createedit/form.blade.php
I want to make changes in this file, I know what I have to change but I don't know how am I supposed to make that change. I have asked this before as well but I'm still confused.
I made changes in the above mentioned file directly in vendor folder and it worked. But I know that it is not the recommended way and I don't want my changes to vanish away on any updates
Can you please please guide me step by step (for once) on how to make changes to this file?
The text was updated successfully, but these errors were encountered: