Configuration
If you haven't already, make sure you publish Iconamic's config file - you'll need to do this:
1php artisan vendor:publish --tag=iconamic-config
There are three config options for Iconamic that you can change in your config/iconamic.php
file.
Options
You can set two defaults to customise where your SVG icons live in your project. By default, the config will look in resources/icons
. You can set a path
and a path_helper
.
path
path
is used to provide a default path to your SVG icons from one of Laravel's path helpers.
path_helper
The path_helper
sets the default Laravel path-helper to use. You can use one of:
app_path
base_path
public_path
resource_path
storage_path
recursive
The recursive
option controls whether Iconamic will recursively list icons in your configured path.
By default, this option is set to false
- this means only icons explicitly within your path are shown.
When set to true
, any sub-folders within your path will also be included.
Usage as defaults
These define the defaults for all fieldtype usages - however you can override these per fieldtype instance if you need.
This means you could have your default pointing to the "resources" directory, but configure a specific fieldtype instance to use "public" path helper instead.
Setting up your path
IMPORTANT: Make sure your path
exists within your project. It can be an empty folder, but it must exist for the fieldtype to work. When using the tag, if an icon is not found, it will silently fail, but the path
and path_helper
must be correctly configured.