Skip to content

Codeinwp/optimole-laravel

Repository files navigation

Optimole Laravel Package

Actions Status

Requirements

  • Laravel >= 9.0

Installation

Install the Optimole Laravel Package in your project using composer:

$ composer require codeinwp/optimole-laravel

If you want, you can publish Optimole's configuration file using the vendor:publish command:

$ php artisan vendor:publish --tag="optimole-config"

Configuration

The Optimole package will remain inactive until you provide an Optimole API key. You can do this by adding the OPTIMOLE_KEY variable to your .env file:

OPTIMOLE_KEY=your-optmole-api-key

If you don't have an API key, you can create an account on Optimole and get your API key.

Usage

By default, the Optimole Laravel Package will optimize all images and assets in your Laravel application if they use the asset helper function. The package also provides two helper functions that you can use in your blade templates. The optimole_asset function will return the URL of the optimized CSS or JS files, while the optimole_image function will return the URL of the optimized image.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages