Download the PHP package devdojo/themes without Composer
On this page you can find all versions of the php package devdojo/themes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package themes
DevDojo Themes Package
This is a package that will add theme support in your Laravel application
Adding Themes
The themes package will look inside of the resources/themes
folder for any folder that has a .json
file inside of it with the same name. (You can change the theme folder location in the config)
As an example if you have a folder called sample-theme and inside that folder you have another file called sample-theme.json with the following contents:
This package will detect this as a new theme. You can also include a sample screenshot of your theme, which would be sample-theme.jpg (800x500px) for best results
In fact, you can checkout the sample-theme repo here: https://github.com/thedevdojo/sample-theme
You can activate this theme by setting the active
column to 1 for that specific theme. Then use it like:
This will then look in the current active theme folder for a new view called welcome.blade.php
:D
Theme Configs
You may choose to publish a config to your project by running:
You will want to publish the themes config, and you will now see a new config located at config/themes.php
, which will look like the following:
Now, you can choose an alternate location for your themes folder. By default this will be put into the resources
folder; however, you can change that to any location you would like.
Warning, If you add the themes folder into the
resources/views
folder and you runphp artisan optimize
you may get an error that it cannot find certain components. This is because it will search all the.blade.php
files inside the views folder. So, this may not be the best place to put your themes. Instead this package will register only the views of the active theme.
Additionally, you can set publish_assets to true or false, if it is set to true anytime the themes directory is scanned it will publish the assets
folder in your theme to the public folder inside a new themes
folder. Set this to false and this will no longer happen.