PHPackages                             cssjockey/laravel-svg - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. cssjockey/laravel-svg

AbandonedArchivedLibrary[Templating &amp; Views](/categories/templating)

cssjockey/laravel-svg
=====================

This package enables a directive @svg(..) which renders the SVG code from the given path or public URL.

1.0.23(4y ago)026MITPHP

Since Jul 14Pushed 4y ago1 watchersCompare

[ Source](https://github.com/cssjockey/laravel-svg)[ Packagist](https://packagist.org/packages/cssjockey/laravel-svg)[ Docs](https://github.com/cssjockey/laravel-svg)[ RSS](/packages/cssjockey-laravel-svg/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)Dependencies (3)Versions (7)Used By (0)

Laravel Svg
===========

[](#laravel-svg)

This package enables a directive **@svg(..)** which renders the SVG code from a given path or public URL.

This package includes, all free SVG icons from [feathericons](https://feathericons.com/) and [heroicons](https://heroicons.com/). However, you can add any SVG icons to your project from multiple local paths. See below for details.

Installation
------------

[](#installation)

You can install the package via composer:

```
$ composer require cssjockey/laravel-svg
```

**Optional:** The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php file:

```
'providers' => [
    // ...
    CSSJockey\LaravelSvg\LaravelSvgServiceProvider::class,
];
```

Configuration
-------------

[](#configuration)

You can publish the config file `config/laravel-svg.php` to add or manage the local paths this package looks for SVG icons.

```
$ php artisan vendor:publish --provider="CSSJockey\LaravelSvg\LaravelSvgServiceProvider"
```

Usage
-----

[](#usage)

Embedding SVG source from a public URL in your blade template.

```
@svg('https://cssjockey.com/public/test.svg')
```

Loading SVG source from a local path in your blade template.

```
@svg('feather/activity')
```

```
@svg('hero/wifi')
```

This will look for all the paths listed in the `config/laravel-svg.php` file and the default package path.

#### Controlling width and height.

[](#controlling-width-and-height)

The SVG files are loaded with full width and height. You can wrap the directive in a div to control the dimensions with a class or style attribute.

**Example using tailwind width class:**

```

    @svg('hero/wifi')

```

**Example using style attribute:**

```

    @svg('hero/wifi')

```

**IMPORTANT:** If you wish to use `` or any other non-block tag, then you must apply `style="display: inline-block"` to the that element.

Changelog
---------

[](#changelog)

Please see the changelog for more information on what has changed recently.

Todo:
-----

[](#todo)

- Add more free icons to the package.
- Create an artisan command to optimize all the SVG files.

Contributing
------------

[](#contributing)

Please see contributing for details.

Security
--------

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

Mohit Aneja All Contributors

License
-------

[](#license)

MIT Please see the license for more information.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~14 days

Total

6

Last Release

1689d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5541a1a071762f2e5261769b015802a4f5c8c01b4655e8ffc87c6ff0f3e6db9e?d=identicon)[cssjockey](/maintainers/cssjockey)

---

Top Contributors

[![maneja81](https://avatars.githubusercontent.com/u/1508283?v=4)](https://github.com/maneja81 "maneja81 (15 commits)")

---

Tags

bladedirectiveslaravelsvglaravelsvgdirectivesblade-svglaravel-svg

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cssjockey-laravel-svg/health.svg)

```
[![Health](https://phpackages.com/badges/cssjockey-laravel-svg/health.svg)](https://phpackages.com/packages/cssjockey-laravel-svg)
```

###  Alternatives

[blade-ui-kit/blade-icons

A package to easily make use of icons in your Laravel Blade views.

2.5k34.2M309](/packages/blade-ui-kit-blade-icons)[robsontenorio/mary

Gorgeous UI components for Livewire powered by daisyUI and Tailwind

1.5k454.7k15](/packages/robsontenorio-mary)[stijnvanouplines/blade-country-flags

A package to easily make use of country flags in your Laravel Blade views.

26307.2k6](/packages/stijnvanouplines-blade-country-flags)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
