Download the PHP package marshmallow/nova-fontawesome without Composer

On this page you can find all versions of the php package marshmallow/nova-fontawesome. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nova-fontawesome

Latest Version on Packagist Total Downloads CI

Laravel Nova Font Awesome Icons

A Laravel Nova field for selecting Font Awesome icons using the Font Awesome GraphQL API. This package loads icons on-demand via API calls, meaning you don't need to bundle all 30,000+ icons in your package.

Features

[!important] This package was originally forked from mdixon18/fontawesome. Since we were making many opinionated changes, we decided to continue development in our own version rather than submitting pull requests that might not benefit all users of the original package. You're welcome to use this package, we're actively maintaining it. If you encounter any issues, please don't hesitate to reach out.

Requirements

Note: For Nova 4 support, use version 1.x: composer require marshmallow/nova-fontawesome:^1.0

Installation

Step 1: Install via Composer

Step 2: Set up Font Awesome CSS

The package needs Font Awesome CSS to render icons. Choose one of these options:

Option A: Self-hosted (Recommended for Pro users)

  1. Download Font Awesome from fontawesome.com
  2. Extract and copy the css and webfonts folders to public/vendor/fontawesome/
  3. Add to your .env:

Option B: Font Awesome Kit (Easiest for Pro)

  1. Get your Kit ID from fontawesome.com/kits
  2. Add to your .env:

Option C: CDN (Free icons only)

No setup needed - this is the fallback if no other strategy is configured:

Step 3: Publish config (optional)

You can also publish the translation files if you want to customise the UI strings:

Step 4: Clear cache

That's it! The package uses the Font Awesome GraphQL API, so you don't need to manually download icon data.

CSS Loading Strategy

The package supports three CSS loading strategies (in order of priority):

1. Self-Hosted CSS (Recommended for Pro)

Download Font Awesome CSS files and host them on your server:

  1. Download Font Awesome from fontawesome.com
  2. Extract and copy to public/vendor/fontawesome/
  3. Set strategy in .env:

Directory structure:

2. Font Awesome Kit

Use your Font Awesome Kit for automatic Pro CSS loading:

Get your Kit ID from fontawesome.com/kits

3. CDN (Fallback - Free only)

Load free icons from CDN (default fallback):

Usage

Basic Usage

Available Methods

Set Font Awesome Version

Limit Icon Styles

Available styles: solid, regular, light, thin, duotone, brands

Set Icon Families

Available families: classic, brands, duotone, sharp, sharp-duotone

Note: Duotone, Sharp, and Sharp-Duotone require Font Awesome Pro.

Free vs Pro Icons

Font Awesome Kit ID (Pro)

Load Pro CSS using your Font Awesome Kit:

Or use a custom Pro CSS URL:

Allow Empty/Null Values

Custom Button Text

Limit Search Results (Per Page)

Minimum Search Length

Set Default Icon

Persist Default Icon

If you want to persist the default icon (when they press clear it brings back the default so it can't be empty):

Limit Available Icons

Client-Side Fuzzy Search

Enable or disable the local fuzzy search fallback:

Complete Example

Icon Class Format

Stored Value Format

The field stores icons in modern FA6/FA7 format:

Legacy Format Support

The package automatically supports legacy FA5 shorthand classes for backwards compatibility:

Legacy Format Converts To
fas fa-home fa-solid fa-home
far fa-user fa-regular fa-user
fab fa-github fa-brands fa-github
fal fa-star fa-light fa-star
fat fa-circle fa-thin fa-circle
fad fa-house fa-duotone fa-solid fa-house

When convert_legacy_format is enabled in config (default), legacy formats are automatically converted when saving.

How It Works

This package uses the Font Awesome GraphQL API to:

  1. Search icons - When you type in the search box, a GraphQL query is sent to Font Awesome's API
  2. Infinite scroll - Results are paginated, loading more as you scroll down
  3. Cache results - Search results are cached for 1 hour to reduce API calls
  4. Fallback gracefully - If the API is unavailable, local fallback icons are used

API Endpoints

The package registers these API routes:

Configuration

After publishing the config file, you can modify config/nova-fontawesome.php:

Environment Variables

Add these to your .env file to customize the configuration:

Getting a Font Awesome API Token

To access Font Awesome Pro icons or improve API rate limits, you'll need an API token:

  1. Create or log in to your Font Awesome account at fontawesome.com/account
  2. Navigate to API Tokens section at fontawesome.com/account#api-tokens
  3. Generate a new token by clicking "Create Token"
  4. Copy the token and add it to your .env file:

Note: API tokens are automatically exchanged for short-lived access tokens and cached for performance. The package handles token refresh automatically.

Displaying Icons

In Blade Views

With Tailwind/Vite

If rendering icons in your frontend (outside Nova), make sure Font Awesome CSS is loaded:

Or via your vite.config.js:

Helper Method (Optional)

You can add a helper to your model:

Troubleshooting

Debug Endpoint

Visit /nova-vendor/nova-fontawesome/debug to check:

Icons not loading

  1. Check the debug endpoint for API errors
  2. Check that your server can reach api.fontawesome.com
  3. Check Laravel logs for errors
  4. Clear the cache: php artisan cache:clear

CSS not loading / Icons showing as boxes

  1. Check your CSS strategy in config
  2. For self-hosted: verify files exist in public/vendor/fontawesome/
  3. For Kit: verify your Kit ID is correct
  4. Check browser console for 404 errors

Styles not filtering correctly

Make sure you're using valid style names: solid, regular, light, thin, duotone, brands

Pro icons not showing

  1. Verify you have an active Font Awesome Pro subscription
  2. Check that your API token is correctly set in .env
  3. Use the debug endpoint to verify token exchange
  4. Ensure your CSS strategy supports Pro icons (self-hosted or kit)

Upgrading

From v1.x to v2.x

  1. Update composer.json requirements
  2. Update package.json - Vite replaces Laravel Mix
  3. Rebuild assets: npm install && npm run build
  4. Update config file if published (new css section replaces pro_css)
  5. See UPGRADE.md for detailed migration guide

Development

Building Assets

Running Tests

Code Style

Static Analysis

License

The MIT License (MIT). Please see License File for more information.

Sponsorships

If you are reliant on this package in your production applications, consider sponsoring us! It is the best way to help us keep doing what we love to do: making great open source software.

Contributing

Feel free to suggest changes, ask for new features or fix bugs yourself. We're sure there are still a lot of improvements that could be made, and we would be very happy to merge useful pull requests.

Special thanks to

Made with love for open source

At Marshmallow we use a lot of open source software as part of our daily work. So when we have an opportunity to give something back, we're super excited!

We hope you will enjoy this small contribution from us and would love to Twitter for more updates!


All versions of nova-fontawesome with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^11.0|^12.0|^13.0
laravel/nova Version ^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package marshmallow/nova-fontawesome contains the following files

Loading the files please wait ...