Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Fontawesome Bundle Laravel Package

zikula/fontawesome-bundle

Zikula FontAwesomeBundle packages Font Awesome assets for Zikula applications, making it easy to include and use scalable icon fonts in themes and templates. It provides a simple integration point for adding Font Awesome icons without managing assets manually.

View on GitHub
Deep Wiki
Context7

Getting Started

This is a Symfony bundle, not a Laravel package — there is no FontAwesomeServiceProvider, no config/fontawesome.php, and no facade. Treat it as a reference implementation for shipping FontAwesome assets, not as a dependency you composer require into a Laravel app.

What to inspect first (5 minutes):

  1. composer.json — confirm the type (symfony-bundle), the extra.symfony block, and the pinned FontAwesome major version. This tells you instantly whether it is FA 4/5 and whether Composer will even resolve it against a modern Laravel stack.
  2. Resources/public/ (or src/Resources/assets/) — the actual CSS/webfont payload. This is the only part with any transferable value.
  3. DependencyInjection/ and any *Extension.php — whether it registers Twig extensions or only asset paths.
  4. Resources/views/ — if there is a Twig helper (e.g. an icon rendering function), note it is unusable from Blade.

The realistic first use case for a Laravel developer: you want <i class="fas fa-user"></i> to render without a runtime CDN call. Do not install this bundle. Install FontAwesome the Laravel way instead:

npm install @fortawesome/fontawesome-free
// resources/js/app.js
import '@fortawesome/fontawesome-free/css/all.min.css';
{{-- resources/views/components/icon.blade.php --}}
@props(['name', 'style' => 'fas'])
<i class="{{ $style }} fa-{{ $name }}" aria-hidden="true"></i>

If you are genuinely inside a legacy Zikula/Symfony 3/4 app and must use the bundle, register it in config/bundles.php:

return [
    Zikula\FontAwesomeBundle\ZikulaFontAwesomeBundle::class => ['all' => true],
];

…then confirm the stylesheet is exposed via assets:install / bin/console assets:install public before expecting icons to appear.

Implementation Patterns

Pattern 1 — Asset-provider only (the portable part). The bundle's core job is copying CSS + webfonts into public/. In Laravel, replicate that with Vite or a publish step rather than a service provider. If you insist on Composer-sourced assets, pair it with laravel-frontend-presets-style publishing:

// app/Providers/AppServiceProvider.php — only if you really want vendor assets
public function boot(): void
{
    $this->publishes([
        base_path('vendor/zikula/fontawesome-bundle/Resources/public') => public_path('vendor/fontawesome'),
    ], 'fontawesome-assets');
}

This works because it touches only the filesystem — it does not boot the Symfony bundle machinery.

Pattern 2 — Blade component wrapper (recommended). Centralise icon markup so a future FontAwesome major upgrade is a one-file change. Add a variant map for fas/far/fab so templates never hardcode style prefixes:

@props(['name', 'style' => 'solid', 'size' => null])
@php
    $styles = ['solid' => 'fas', 'regular' => 'far', 'brands' => 'fab'];
@endphp
<i class="{{ $styles[$style] }} fa-{{ $name }} {{ $size ? 'fa-'.$size : '' }}"
   aria-hidden="true"></i>

Usage: <x-icon name="user" style="solid" size="lg" />.

Pattern 3 — Subset + tree-shake for production. The bundle ships the full font, which is ~1MB+ of webfonts. For Laravel, use @fortawesome/fontawesome-svg-core with explicit icon imports so only used glyphs are bundled:

import { library, dom } from '@fortawesome/fontawesome-svg-core';
import { faUser, faCartShopping } from '@fortawesome/free-solid-svg-icons';
library.add(faUser, faCartShopping);
dom.watch(); // replaces <i> placeholders with inline SVG

Pattern 4 — CDN fallback for prototypes. Fastest path in a throwaway app; equivalent to what the bundle achieves, minus the install:

<link rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/css/all.min.css"
      integrity="..." crossorigin="anonymous" referrerpolicy="no-referrer">

Pin the version and use SRI if you keep this beyond prototyping.

Pattern 5 — Bridging into an existing Symfony app. If the codebase is Symfony and FontAwesomeBundle already exists, do not add a second FA source. Configure the bundle, run assets:install, and reference icons only through its Twig helper (if present) or plain <i> tags. Mixing the bundle's FA 5 webfont with an npm-installed FA 6 is the single most common cause of "icons show as boxes."

Gotchas and Tips

  • Archived and abandoned. Last release 2019-12-30, 3 stars, 0 dependents. No security patches, no PHP 8.2+/Laravel 10/11 compatibility guarantee. The opportunity: 8.81 score is misleading — it reflects that FontAwesome integration is high-value, not that this package is. Capture the opportunity with maintained tooling, not this repo.
  • Symfony bundle auto-discovery does not exist in Laravel. Laravel ignores extra.symfony.endpoint; nothing registers automatically. Any attempt to use its DI extension will fail on Symfony\Component\DependencyInjection classes that Laravel does not ship.
  • Twig dependency. If the bundle exposes a Twig function/extension for icons, it is dead code under Blade. Do not try to bolt Twig into Laravel for this — write the five-line Blade component instead.
  • FontAwesome version lock. The CSS class vocabulary changed between FA 4 (fa fa-user), FA 5 (fas fa-user), and FA 6 (SVG-first, fa-solid). Check which one the bundle vendors before copying any markup examples from its README; mismatched prefixes render empty squares.
  • Webfont paths break after publishing. The CSS references ../webfonts/* relatively. If you publish only css/ and not webfonts/, icons silently 404. Verify with the browser Network tab, not by eyeballing the page.
  • CSP and font-src. Self-hosted webfonts require font-src 'self'; CDN usage requires the CDN origin. This bites in apps with a strict Content-Security-Policy middleware — icons vanish with no PHP error.
  • Debugging checklist: (1) composer why zikula/fontawesome-bundle to confirm it is even installed; (2) php artisan vendor:publish --tag=fontawesome-assets; (3) confirm the <link> is in the rendered HTML, not just in a layout you think is used; (4) curl -I the woff2 URL directly.
  • Extension point worth stealing: the bundle's asset-path registration is the only reusable idea. Mirror it as a Laravel ServiceProvider publishes() call (Pattern 1) so upgrades are a composer update + republish, not a manual file copy.
  • Migration advice. For any greenfield Laravel work, standardise on @fortawesome/fontawesome-free (npm) plus an <x-icon> Blade component. It gives you version pinning via package-lock.json, Vite cache-busting, and tree-shaking — none of which this bundle offers.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections