Is making changes to files inside the Spark directory OK?
Is making changes to files inside the Spark directory OK?
At the moment I just want to make some changes to Spark's views, routes and controllers. Should I simply overwrite them and put all my changes inside /app/ or can I make some changes to files in /spark?
What about resources/views/vendor/spark and all the Vue scripts?
The /spark folder should not be touched, but you can make edits to anything in the /resources/views/vendor/spark folder if you need to update the views.
If there is an update to spark in future, any changes you have made will not be lost.
@duellsy your answer is not correct, please update it.
Changes made in /vendor/ folder will be overwritten in next update (that'swhere all the spark source files are)
Only difference is for the spark view files that are exported to the application on installation into /recources/views/vendor/spark -> these can be changed as mentioned on spark docs and will not be overwritten
So if we shouldn't modify the spark source files, what do you do if you need to modify the spark base code to fit your use cases? So far I've just been modifying anything I need to with the understanding that I won't easily be able to update my project, but is there a better way?
I've been modifying the vendor files inside /resources because they're just views, but if I have to change something in the /spark directory, I've been just overwriting the route in the /app folder and creating new controllers.
There is a Spark::swap method that should serve almost all of these cases if you need to change something in Spark Code (that is at least what the documentation claims)
@cristoNever touch any files in your vendor or spark directories.
From the Spark documentation:
When you create a new application using spark new, all of the Spark views are automatically exported to your application's resources/views/vendor/spark directory. You may customize any of these views as needed.
I'm starting a project that uses Spark as an API, ditching all views and Vue related things...building a custom Angular Single Page App that is hosted not in the public folder but in an another host.
I would like to document Spark's controller/routes and models with L5-Swagger but for that I would need to modify the core files for adding php annotations.
Apparently that is not an option. Perhaps there is another way to define Swagger annotations on routes files perhaps...
A feature suggestion for Spark: You perhaps could make /spark folder's source files editable and updatable like so that when update is run, check which files have been modified and either leave untouched and notify after the update OR try to merge those two file versions in the git manner...