Download the PHP package enflow/laravel-svg without Composer

On this page you can find all versions of the php package enflow/laravel-svg. 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 laravel-svg

Using SVGs with easy

Latest Version on Packagist GitHub Workflow Status Total Downloads

The enflow/laravel-svg package provides a easy way include SVGs in your templates.

Installation

You can install the package via composer:

Usage

You may use the svg helper in your templates

Config

You may publish the config to set the packs that you are using:

Pushing the config file:

Packs

You may specify multiple packs that are used in your application. By default, only the resources/img/svgs pack is included, but you may specify additional icon sets like Font Awesome in your config. When the pack isn't specified when including the SVG, the first one that can be found in the order defined in your config will be used. You may overrule this behavior by calling the pack method on the Enflow\Svg\Svg class that's returned by the SVG helper.

Examples

Font Awesome 5 Free

Installing

composer require fortawesome/font-awesome

Reference: https://github.com/FortAwesome/Font-Awesome

Config

Font Awesome 5 Pro

Installing

yarn add @fortawesome/fontawesome-pro

Font Awesome 5 doesn't provide a composer package. We'll install it through our npm/yarn pipeline and use that path instead

Reference: https://fontawesome.com/how-to-use/on-the-web/setup/using-package-managers

Config

Middleware

This package includes the Enflow\Svg\Middleware\InjectSvgSpritesheet middleware which is automatically registered and added to your web group.

This will add the SVG spritesheet to the top of your templates, where all unique SVGs are added. The SVGs rendered in your templates will reference this spritesheet. The reason for this is that in a loop, the SVG only is once in the body, instead of repeating it per row.

You may disable the automatic injection by setting the register_middleware_automatically to false:

config/svg.php

Using with other middleware

When using enflow/laravel-svg in combination with another middleware that must always be executed after the SVGs are injected in the response, you may use the $middlewarePriority logic on the Laravel router to ensure it's always run after.

The order in this array is counterintuitive: at first must the CacheResponse middleware be specified, and then the SVG injection middleware. This is due to the way middleware responses are build. This ensures that first the SVGs are injected, and that complete response is cached.

Example for usage with spatie/laravel-responsecache

app/Http/Kernel.php

Testing

Contributing

Please see CONTRIBUTING for details.

Security

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

Credits

Special thanks

About Enflow

Enflow is a digital creative agency based in Alphen aan den Rijn, Netherlands. We specialize in developing web applications, mobile applications and websites. You can find more info on our website.

License

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


All versions of laravel-svg with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.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 enflow/laravel-svg contains the following files

Loading the files please wait ....